#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVL; typedef vector VVI; typedef pair P; typedef pair PL; bool check(int x[3]){ int a = x[0], b = x[1], c = x[2]; return (a != c) && ((b > a && b > c) || (b < a && b < c)); } int main() { int a[3], x; REP(i,3){ char c; cin >> c; if (c == '?') x = i; else a[i] = c - '0'; } a[x] = 1; if (check(a)) cout << '1'; a[x] = 4; if (check(a)) cout << '4'; cout << endl; return 0; }