#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP(i, x) for(int (i) = 0; (i) < (x); (i) ++) #define PREP(i, s, x) for(int (i) = (s); (i) < (x); (i) ++) #define MREP(i, s, x) for(int (i) = (s); (i) >= (x); (i) --) #define IREP(i) for(int (i) = 0; ; (i) ++) #define MOD 1000000007 #define PI (acos(-1)) // long long型の最大値:LLONG_MAX // long long型の最小値:LLONG_MIN // int型の最大値:INT_MAX // int型の最小値:INT_MIN // 絶対値:abs(n) using namespace std; int main(){ long long a, b; cin >> a >> b; long long c; if(a > b){ a = a ^ b; b = a ^ b; a = a ^ b; } if(a == 1 && b == 2){ c = 3; }else if(a == 1 && b == 3){ c = 2; }else if(a == 2 && b == 3){ c = 1; }else{ c = -1; } cout << c << endl; return 0; }