using System; using System.Linq; class No587 { static void Main() { var str = Console.ReadLine(); var count = 0; var ans = ""; while (0 < str.Length) { Console.WriteLine(str.Length); Console.WriteLine(str); var temp = str[0]; str.Remove(0,1); Console.WriteLine(str); if (str.Contains(temp)) { str.Replace(temp.ToString(), ""); count++; } else ans = temp.ToString(); } Console.WriteLine(count == 6 ? ans : "Impossible"); } }