using System; using System.Linq; class No587 { static void Main() { var str = Console.ReadLine(); var count = 0; var ans = ""; foreach (var c in str) { if (c != 0) { str.Remove(c); if (str.Contains(c)) { str.Replace(c, '0'); count++; } else ans = c.ToString(); } } Console.WriteLine(count == 6 ? ans : "Impossible"); } }