#include using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template using V = vector; template using VV = V>; template using VVV = V>; template using VVVV = VV>; #define rep(i,n) for(ll i=0ll;i void chmin(T& t, const U& u) { if (t > u) t = u; } template void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); void solve(){ V v(3); rep(i,3){ cin >> v[i]; if(v[i] == '?') v[i] = 1; } string s; if((v[0]-v[1])*(v[2]-v[1])>0) s += "1"; rep(i,3) if(v[i]==1) v[i] = 4; if((v[0]-v[1])*(v[2]-v[1])>0) s += "4"; cout << s << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }