Kabaleo Lite

No attempts yetTime limit1sMemory limit128 MB

Problem

Kabaleo Lite is a board game. The board holds several stacks of conical chips of various colours, and only the colour of the top chip of a stack is visible.

Every player has one target colour of their own and a set of coloured chips. The target colour is hidden from the other players, while the chips are visible to everyone. On a turn a player picks one of their chips and puts it on one of the stacks, which repaints that stack in the colour of the chip.

After the last turn, count the visible chips of every colour. The winning colour is the colour that occurs the most times. The player who has that colour as a target colour wins the game. If nobody has it, or if two or more colours occur the maximum number of times, the game ends in a draw.

You are about to play your last chip. Every other player has one chip left as well. You move first, then the others move in the order they are given. You do not know their target colours and you cannot predict their moves, so a stack counts as a winning move only when placing your chip there makes you win whatever the others do.

Input

The first line has four integers nn, pp, cc and hh: the number of stacks on the board (1n1061 \le n \le 10^6), the number of players (1p1061 \le p \le 10^6), the number of chip colours (pc106p \le c \le 10^6) and your own hidden colour (1hc1 \le h \le c).

The second line has nn integers bib_i, the visible colour of stack ii (1bic1 \le b_i \le c).

The third line has pp integers lil_i, the colour of the last chip of player ii (1lic1 \le l_i \le c). Players are numbered from 1 to pp in the order of their turns, and you are player 1.

Output

On the first line print ww, the number of winning moves.

On the second line print the numbers of those stacks in increasing order, separated by single spaces. Stacks are numbered from 1 in the order their visible colours are given in the input. If w=0w = 0, leave the second line empty.

A stack belongs on that line only when your win is guaranteed for every possible set of moves by the other players.

Note

In the first example, placing your chip on stack 4 is not enough. The other players can answer on stack 1 and stack 3, and then colour 1 and colour 2 are both visible three times, so the game ends in a draw.