PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000121. Chọn tập con nhiều phần tử nhất có tổng hợp số (Windblume Ode)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Chọn tập con nhiều phần tử nhất có tổng hợp số (Windblume Ode)

Windblume Ode

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

The Windblume Ode bears an array of nn pairwise distinct positive integers. Select a subset of positions so that the sum of the selected values is composite.

Maximize the number of selected elements. A positive integer ss is composite if s>1s>1 and it has a positive divisor other than 11 and itself. A nonempty valid subset is guaranteed to exist, and any maximum-size subset is accepted.

Input

The first line contains nn. The second line contains nn pairwise distinct positive integers a1,a2,…,ana_1,a_2,\ldots,a_n.

Output

Print the maximum subset size kk on the first line. The second line contains exactly kk distinct indices from 11 to nn of the selected elements.

Subtasks

  • Subtask 1 (20 points): 3≤n≤83\le n\le8; 1≤ai≤201\le a_i\le20 and aia_i pairwise distinct.
  • Subtask 2 (30 points): 3≤n≤303\le n\le30; 1≤ai≤1001\le a_i\le100 and aia_i pairwise distinct.
  • Subtask 3 (50 points): 3≤n≤1003\le n\le100; 1≤ai≤2001\le a_i\le200 and aia_i pairwise distinct.

Examples

Input

3
8 1 2

Output

2
1 3

Explanation

The three values 8,1,28,1,2 sum to 1111, which is prime, so all three cannot be selected. Excluding position 22 (value 11) leaves positions 11 and 33, with sum 8+2=10=2⋅58+2=10=2\cdot5, a composite number. Thus the maximum subset size is k=2k=2.