Counting Friends

No attempts yetTime limit1sMemory limit128 MB

Problem

Farmer John has NN cows (2N5002 \le N \le 500) on the social network MooBook.

Each cow has one or more friends on MooBook. While writing down every cow's friend count, Farmer John got distracted and accidentally wrote one extra number. His list therefore has N+1N+1 entries instead of NN.

Find every entry that could be the mistaken extra number.

Input

  • Line 1: integer NN
  • Lines 2 through N+2N+2: one integer per line, either a cow's friend count or the extra mistaken number

Output

  • Line 1: integer KK, the number of entries that could be the extra number (K=0K=0 means no removal leaves a valid friend assignment)
  • Next KK lines: indices from 1 through N+1N+1 in the input order. Print an index if removing that entry leaves NN counts that can be realized as mutual friendships among NN cows. Print indices in sorted order.