#include using namespace std; bool isok(int a, int b, int c) { if(max({a, b, c}) == b) return (true); if(min({a, b, c}) == b) return (true); return (false); } int main() { char x, y, z; cin >> x >> y >> z; if(z == '?') swap(z, x); string ret; if(x == '?') { if(isok('1', y, z)) ret += "1"; if(isok('4', y, z)) ret += "4"; } else { if(isok(x, '1', z)) ret += "1"; if(isok(x, '4', z)) ret += "4"; } cout << ret << endl; }