#include #include #include #define REP(i, a, b) for (int i = int(a); i < int(b); i++) #define dump(s) cerr << __LINE__ << "\t:" << #s << " = " << (s) << endl using namespace std; int main () { char c[3]; REP (i, 0, 3) cin >> c[i]; auto chk = [](char s[3]) -> bool { return (s[0] < s[1] && s[1] > s[2]) || (s[0] > s[1] && s[1] < s[2]); }; REP (i, 0, 3) { if (c[i] == '?') { char lst[2] = {'1', '4'}; REP (j, 0, 2) { c[i] = lst[j]; if (chk(c)) cout << lst[j]; } } } cout << endl; return 0; }