using System; using System.Linq; namespace _632 { class Program { static void Main(string[] args) { string s = Console.ReadLine(); int[] x = s.Replace("?","1").Split().Select(int.Parse).ToArray(); int[] y = s.Replace("?","4").Split().Select(int.Parse).ToArray(); if (x[1] == x.Max() || x[1] == x.Min()) Console.Write(1); if (y[1] == y.Max() || y[1] == y.Min()) Console.Write(4); Console.WriteLine(); } } }