using System; class Program { static void Main() { string[] s = Console.ReadLine()!.Split(); int a = s[0] == "?" ? -1 : int.Parse(s[0]); int b = s[1] == "?" ? -1 : int.Parse(s[1]); int c = s[2] == "?" ? -1 : int.Parse(s[2]); string ans = ""; foreach (int x in new int[] { 1, 4 }) { int A = a == -1 ? x : a; int B = b == -1 ? x : b; int C = c == -1 ? x : c; if (A != B && B != C && A != C && (B == Math.Max(A, Math.Max(B, C)) || B == Math.Min(A, Math.Min(B, C)))) { ans += x; } } Console.WriteLine(ans); } }