KLONOVI | 프로그래밍의 벗 PivotOJ
PivotOJ

KLONOVI

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2009 National Competition #2 - JuniorsBOJ 3113

문제

Simona breeds sheep. Not being patient enough to wait for sheep to multiply naturally, she built a cloning facility with N machines in it. 

Cloning machines have keyboards that can be used to type in positive integers. If there are K sheep in a machine and the number p is typed in, after pressing the button "Clone" cloning starts and soon after p·K sheep can be found in the machine! For reasons unknown to Simona, cloning only works if the number p is prime. Also, every machine has a maximum capacity – the largest number of sheep that it can hold. 

Simona got tired of walking from machine to machine pressing buttons. So she hired N assistants, one for each machine, and now yells out commands to the assistants: 

  • ENTER p – every assistant types p into the keyboard; p must be prime. 
  • CLONE a1 a2 ... aK – assistants near machines a1, a2, ..., aK all press "Clone". These numbers are distinct (so that assistants don't get confused). Because Simona's concentration is limited, she can say at most M numbers in a single CLONE commands. 

Simona initially puts one sheep into every machine. In order to fully use the machines, Simona wants to fill every machine up to its maximum capacity. Once a sequence of commands begins, it is not allowed to take sheep out of machines. Also, Simona wants to yell out as few commands as possible to fill all machines with sheep. 

Write a program that determines any shortest sequence of commands that will completely fill all machines with sheep. 

입력

The first line contains the integer N (1 ≤ N ≤ 50), the number of cloning machines. 

The second line contains N integers, each less than 1 000 000 000. These numbers are the capacities of the machines. 

The third line contains the integer M (1 ≤ M ≤ N), the largest number of machines Simona can trigger in a single CLONE command. 

출력

Output Simona's commands, each on its own line. If multiple solutions exist, output any of them.

예제

예제 1

입력
3
2 3 6
2
출력
ENTER 2
CLONE 1 3
ENTER 3
CLONE 2 3

예제 2

입력
5
25 25 30 25 25
3
출력
ENTER 2
CLONE 3
ENTER 5
CLONE 1 2 3
CLONE 5 4 1
CLONE 2 4 5
ENTER 3
CLONE 3
코드를 제출하려면 로그인하세요.