Problem F
Wi Know
You are the boss of Wi Know, an upstanding company in information theory, especially in message encryption.
The counter-counter-intelligence branch of your upstanding
company managed to intercept a message sent by the
counter-intelligence agency of the local Helsinkian government.
This message is, of course, of utmost importance, and its
content can probably be used for the “greater good” later. The
message is a sequence
As the first step to mine useful information from this
message, you first have to find patterns in it. At the moment,
the pattern we’re interested in is whether there exists two
different integers
Your task is to find such a pattern, if any, and print both
Input
The first line contains a non-negative integer
Output
If
Sample Input 1 | Sample Output 1 |
---|---|
8 1 3 2 4 1 5 2 4 |
1 2 |
Sample Input 2 | Sample Output 2 |
---|---|
8 1 2 3 4 5 6 7 1 |
-1 |
Sample Input 3 | Sample Output 3 |
---|---|
4 2 1 2 1 |
2 1 |