Under construction

Still being built. Things may change

Answer

Time limit2sMemory limit1024 MB

Summary
Find three distinct numbers from the list that, concatenated in some order, form a palindrome with no leading zeros.
Level

Medium5 of 10

Topics
String, Brute force, Hash map
Solved
No attempts yet

Problem

Many people did not believe that the answer to the ultimate question of life, the universe, and everything is 42. Big Computer was upset by this, so it tried to find the answer again. It built another computer, which produced a list of nn natural numbers. No two numbers in the list are equal.

Big Computer decided that if the list contains three different numbers that, written one after another, form a palindrome (a number that reads the same from left to right and from right to left), then the answer is that palindrome. Leading zeros in the palindrome are not allowed.

Suddenly a cartoon that is very interesting to Big Computer came on television, so it asked you to solve this problem.

Input

The first line of the input file contains one natural number nn (1≤n≤9001 \le n \le 900), the count of generated numbers. The second line contains the numbers themselves. All numbers are pairwise distinct, positive integers, and do not exceed 10910^9.

Output

Print on a single line, separated by spaces, the three numbers whose concatenation forms the palindrome. If there are several answers, print any of them. If no answer exists, print <<Sorry, but I don't know answer!>>.

Examples2

  1. Example 1

    Input
    4
    12 21 45 3
    
    Expected output
    12 3 21
    
  2. Example 2

    Input
    1
    42
    
    Expected output
    Sorry, but I don't know answer!