|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|2 초 (추가 시간 없음)||512 MB||0||0||0||0.000%|
Masha has a playlist of several songs in her music player. She listens to the songs in order (playlist is not cyclic: when the last song ends the player turns off). Masha likes repetitions, so she feels happy every time a song ends and the same one starts playing. When the same songs are separated by another one, Masha doesn't consider it a repetition.
The player doesn't have options of adding songs to playlist or shuffling it. But it can remove songs from the list. Your task is to remove some songs to maximize the number of repetitions (you may also remove everything or nothing from the list).
The first line contains an integer $n$: the number of songs in the playlist ($1 \le n \le 50$). The second line contains $n$ space-separated numbers: the songs in the list. For clarity, the songs are denoted by integer numbers from $1$ to $50$.
On the first line, print two space-separated numbers $m$ and $k$: the number of songs in the edited playlist and the number of repetitions in it. On the second line, print the playlist: $m$ space-separated numbers.
If there are several possible answers, print any one of them. If the list is empty, you can either print or not print the second line (which would be empty).
3 1 2 1
2 1 1 1
7 2 1 2 1 3 2 5
4 2 2 2 2 5