시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 512 MB0000.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).

예제 입력 1

3
1 2 1

예제 출력 1

2 1
1 1

예제 입력 2

7
2 1 2 1 3 2 5

예제 출력 2

4 2
2 2 2 5