#include #define f first #define s second using namespace std; typedef long long int ll; using T_=pair; void routine(){ ll a,b; cin >> a >> b; ll x = max(a,b),y = min(a,b); if(x == y){ cout << (x+y-((x+y)/4)*4) << "\n"; return; } cout << (-x+3*y-((-x+3*y)/4)*4) << "\n"; return; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll t = 1; while(t--){ routine(); } return 0; }