#include #include #include #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define repR(i, n) for(int i = (n) - 1; i > -1; i--) #define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++) #define rep1R(i, n) for(int i = (n); i > 0; i--) #define ll long long using namespace std; bool is_kadomatu(int a1, int a2, int a3) { return (a1 != a2 && a2 != a3 && a3 != a1) && ((a2 >= a1 && a2 >= a3) || (a2 <= a1 && a2 <= a3)); } int main() { int c1 = 0, c2 = 0, c3 = 0; int pos; string s; cin >> s; if (s != "?") c1 = stoi(s); else pos = 1; cin >> s; if (s != "?") c2 = stoi(s); else pos = 2; cin >> s; if (s != "?") c3 = stoi(s); else pos = 3; string result = ""; if (pos == 1) { if (is_kadomatu(1, c2, c3)) result += "1"; if (is_kadomatu(4, c2, c3)) result += "4"; } else if (pos == 2) { if (is_kadomatu(c1, 1, c3)) result += "1"; if (is_kadomatu(c1, 4, c3)) result += "4"; } else if (pos == 3) { if (is_kadomatu(c1, c2, 1)) result += "1"; if (is_kadomatu(c1, c2, 4)) result += "4"; } else { cout << "error" << endl; } cout << result << endl; return 0; }