#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() template void make_unique(std::vector &vec) { std::sort(vec.begin(), vec.end()); vec.erase(unique(vec.begin(), vec.end()), vec.end()); } using namespace std; class JapaneseStyle { public: void solve(void) { int N; cin>>N; vector ans; REP(i, N) { int x,y; cin>>x>>y; ans.push_back(y-x); } make_unique(ans); if (ans.size()==1 && ans[0] > 0) cout<solve(); delete obj; return 0; } #endif