stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.116064595521437x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

L E=70;

W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1133526163158183x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

L E=70;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}for(int i;i<2;i++){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}int main(){L M=2e17,n,a,b;cin>>n;V<W>p(n);for(int i;i<n;i++){cin>>a>>b;p[i]={a+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1150090854142314x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

#define R(n)for(L i;i<n;i++){L c

L E=70;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2)=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}int main(){L M=2e17,n,b;cin>>n;V<W>p(n);R(n);cin>>c>>b;p[i]={c+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1144512950006469x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

L E=70;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}L i=2;while(i--){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}int main(){L M=2e17,n,a,b;cin>>n;V<W>p(n);while(n--){cin>>a>>b;p[n]={a+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1150046082339764x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

L E=70,M=2e17,n,a,b;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}for(L i;i<2;i++){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}int main(){cin>>n;V<W>p(n);while(n--){cin>>a>>b;p[n]={a+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1178609621616193x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

L E=70,M=2e17,i,a,b;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}for(L i;i<2;i++){L c=0;for(W x:T[!i])c^=(2*x[0]+x[1])%3+1;if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p)v[0]++;W A=S(p);A[0]--;return A;}int main(){cin>>i;V<W>p(i);while(i--,cin>>a>>b)p[i]={a+M,b+M};W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long long

#define W V<L>

#define R(n) for(L i=0;i<n;i++)

W S(V<W>p,L E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){W A=S(T[i],E-1);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}cout<<S(p,70)[0]-M<<" "<<S(p,70)[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.117785259213761x):
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define L long

#define W V<L>

L E=70,M=2e17,i,a,b;W S(V<W>p){if(!E)return{1,0};V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1)T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}for(L i;i<2;i++){L c=0;for(W x:T[!i])c^=(2*x[0]+x[1])%3+1;if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p)v[0]++;W A=S(p);A[0]--;return A;}int main(){cin>>i;V<W>p(i);while(i--,cin>>a>>b)p[i]={a+M,b+M};W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

vel solve(V<vel>& ab, int ex) {

	if (ex == 0) { return { 1, 0 }; }

	V<vel> ab0, ab1;

	for (auto x : ab) {

		int a1 = x[0];

		int b1 = x[1];

		if (b1 % 2 == 0) {

			ab0.push_back({ a1 / 2, b1 / 2 });

			if (a1 % 2 == 1) { ab1.push_back({ a1 / 2, b1 / 2 }); }

		}

		else {

			ab1.push_back({ a1 / 2, b1 / 2 });

			if (a1 % 2 == 1) { ab0.push_back({ a1 / 2, (b1 + 1) / 2 }); }

		}

	}

	vel c0(2), c1(2);

	for (auto x : ab0) {

		int qc = (3 - x[0] + x[1]) % 3; qc = (qc + 3) % 3;

		if (qc == 0) { c0[0] ^= 1; }

		if (qc == 1) { c0[1] ^= 1; }

		if (qc == 2) { c0[0] ^= 1; c0[1] ^= 1; }

	}

	for (auto x : ab1) {

		int qc = (3 - x[0] + x[1]) % 3; qc = (qc + 3) % 3;

		if (qc == 0) { c1[0] ^= 1; }

		if (qc == 1) { c1[1] ^= 1; }

		if (qc == 2) { c1[0] ^= 1; c1[1] ^= 1; }

	}

	vel ze(2, 0);

	if (c0 == ze) {

		vel ans = solve(ab1, ex - 1);

		ans[0] *= 2; ans[1] *= 2;ans[1]++;

		return ans;

	}

	if (c1 == ze) {

		vel ans = solve(ab0, ex - 1);

		ans[0] *= 2; ans[1] *= 2;

		return ans;

	}

	rep(i, ab.size()) { ab[i][0]++; }

	vel ans = solve(ab, ex); ans[0]--;

	return ans;

}

signed main() {

	int inf = 1;

	rep(i, 57) { inf *= 2; }

	int n; cin >> n;

	V<vel> ab(n);

	rep(i, n) {

		int a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	vel ret = solve(ab, 70);

	cout << ret[0] - inf << " " << ret[1] - inf << "\n";

}

// Faster C++ solution for the same problem (measured speedup: 1.0996621966020068x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}
// Slower C++ solution:
#include<iostream>

#include<algorithm>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

vel solve(V<vel>& ab, int ex) {

	if (ex == 0) { return { 1, 0 }; }

	V<V<vel>> qab(2);

	for (vel x : ab) {

		int a1 = x[0];

		int b1 = x[1];

		qab[x[1] & 1].push_back({ x[0] / 2,x[1] / 2 });

		if (x[0] & 1) { qab[(x[1] + 1) & 1].push_back({ x[0] / 2,(x[1] + 1) / 2 }); }

	}

	V<vel> c(3,vel(2));

	rep(i, 2) {

		for (auto x : qab[i]) {

			int qc = (3 - x[0] + x[1]) % 3; qc = (qc + 3) % 3;

			if (qc == 0) { c[i][0] ^= 1; }

			if (qc == 1) { c[i][1] ^= 1; }

			if (qc == 2) { c[i][0] ^= 1; c[i][1] ^= 1; }

		}

	}

	if (c[0] == c[2]) {

		vel ans = solve(qab[1], ex - 1);

		ans[0] *= 2; ans[1] *= 2;ans[1]++;

		return ans;

	}

	if (c[1] == c[2]) {

		vel ans = solve(qab[0], ex - 1);

		ans[0] *= 2; ans[1] *= 2;

		return ans;

	}

	rep(i, ab.size()) { ab[i][0]++; }

	vel ans = solve(ab, ex); ans[0]--;

	return ans;

}

signed main() {

	int inf = 2e17;

	int n; cin >> n;

	V<vel> ab(n);

	rep(i, n) {

		int a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	vel ret = solve(ab, 70);

	cout << ret[0] - inf << " " << ret[1] - inf << "\n";

}

// Faster C++ solution for the same problem (measured speedup: 1.15296307662922x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

vel solve(V<vel>& ab, int ex) {

	if (ex == 0) { return { 1, 0 }; }

	V<V<vel>> qab(2);

	for (vel x : ab) {

		qab[x[1] & 1].push_back({ x[0] / 2,x[1] / 2 });

		if (x[0] & 1) { qab[(x[1] + 1) & 1].push_back({ x[0] / 2,(x[1] + 1) / 2 }); }

	}

	V<vel> c(3,vel(2));

	rep(i, 2) {

		for (vel x : qab[i]) {

			int qc = (3 - x[0] + x[1]) % 3; qc = (qc + 3) % 3;

			if (qc==0) { c[i][0] ^= 1; }

			if (qc==1) { c[i][1] ^= 1; }

			if (qc == 2) { c[i][0] ^= 1; c[i][1] ^= 1; }

		}

	}

	rep(i, 2) {

		if (c[1-i] == c[2]) {

			vel ans = solve(qab[i], ex - 1);

			ans[0] *= 2; ans[1] *= 2; ans[1] += i;

			return ans;

		}

	}

	rep(i, ab.size()) { ab[i][0]++; }

	vel ans = solve(ab, ex); ans[0]--;

	return ans;

}

signed main() {

	int inf = 2e17;

	int n; cin >> n;

	V<vel> ab(n);

	rep(i, n) {

		int a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	vel ret = solve(ab, 70);

	cout << ret[0] - inf << " " << ret[1] - inf << "\n";

}

// Faster C++ solution for the same problem (measured speedup: 1.15265912868614x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define vel V<long long>

#define rep(i,n) for(int i=0;i<n;i++)

vel solve(V<vel>& ab, int ex) {

	if (!ex) { return { 1, 0 }; }

	V<V<vel>> qab(2);

	for (vel x : ab) {

		qab[x[1] & 1].push_back({ x[0] / 2,x[1] / 2 });

		if (x[0] & 1) { qab[(x[1] + 1) & 1].push_back({ x[0] / 2,(x[1] + 1) / 2 }); }

	}

	V<vel> c(3, vel(2));

	rep(i, 2) {

		for (vel x : qab[i]) {

			int qc = (2 * x[0] + x[1]) % 3;

			if ((qc+1)%2) { c[i][0] ^= 1; }

			if (qc) { c[i][1] ^= 1; }

		}

	}

	rep(i, 2) {

		if (c[1 - i] == c[2]) {

			vel ans = solve(qab[i], ex - 1);

			ans[0] *= 2; ans[1] *= 2; ans[1] += i;

			return ans;

		}

	}

	for(vel &v:ab) { v[0]++; }

	vel ans = solve(ab, ex); ans[0]--;

	return ans;

}

int main() {

	long long inf = 2e17;

	int n; cin >> n;

	V<vel> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	vel ret = solve(ab, 70);

	cout << ret[0] - inf << " " << ret[1] - inf << "\n";

}

// Faster C++ solution for the same problem (measured speedup: 1.1585489584216384x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include<bits/stdc++.h>

using namespace std;

#define V vector

#define W V<long long>

#define R(i,n) for(int i=0;i<n;i++)

W S(V<W>&p,int E) {

	if (!E) { return { 1, 0 }; }

	V<V<W>> T(2);

	for (W x : p) {

		T[x[1] & 1].push_back({ x[0] / 2,x[1] / 2 });

		if (x[0] & 1) { T[(x[1] + 1) & 1].push_back({ x[0] / 2,(x[1] + 1) / 2 }); }

	}

	V<W> c(3,W(2));

	R(i, 2) {

		for (W x : T[i]) {

			int Q = (2 * x[0] + x[1]) % 3;

			if ((Q+ 1) % 2) { c[i][0] ^= 1; }

			if (Q) { c[i][1] ^= 1; }

		}

	}

	R(i, 2) {

		if (c[1 - i] == c[2]) {

			W ans = S(T[i], E-1);

			ans[0] *= 2; ans[1] *= 2; ans[1] += i;

			return ans;

		}

	}

	for (W&v : p) { v[0]++; }

	W A=S(p, E);A[0]--;return A;

}

int main() {

	long long M = 2e17;

	int n; cin >> n;

	V<W> p(n);

	R(i, n) {

		long long a, b; cin >> a >> b;

		p[i] = { a + M,b + M };

	}

	W Q = S(p, 70);

	cout << Q[0] - M << " " << Q[1] - M;

}

// Faster C++ solution for the same problem (measured speedup: 1.1509698434279103x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define V vector

#define W V<long long>

#define R(i,n) for(int i=0;i<n;i++)

W S(V<W>&p,int E){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}V<W>c(3,W(2));R(i,2){for(W x:T[i]){int Q=(2*x[0]+x[1])%3;if((Q+1)%2){c[i][0]^=1;}if(Q){c[i][1]^=1;}}}R(i,2){if(c[1-i]==c[2]){W ans=S(T[i],E-1);ans[0]*=2;ans[1]*=2;ans[1]+=i;return ans;}}for(W&v:p){v[0]++;}W A=S(p,E);A[0]--;return A;}

int main(){long long M=2e17;int n;cin>>n;V<W>p(n);R(i,n){long long a,b;cin>>a>>b;p[i]={a+M,b+M};}W Q=S(p,70);cout<<Q[0]-M<<" "<<Q[1]-M;}

// Faster C++ solution for the same problem (measured speedup: 1.1509698434279103x):
#include<iostream>

#include<vector>

using namespace std;

#define int long long

#define V vector

#define vel V<int>

#define rep(i,n) for(int i=0;i<n;i++)

#define mkp make_pair

#define pin pair<int,int>

pin solve(V<pin>& ab, int ex) {

	if (!ex) { return mkp(0, 0); }

	V<V<pin>> qab(2);

	int sz = ab.size();

	qab[0].reserve(sz);

	qab[1].reserve(sz);

	for (pin& x : ab) {

		qab[x.second & 1].push_back(mkp(x.first>>1, x.second>>1));

		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first>>1, (x.second + 1)>>1)); }

	}

	int c = 0;

	for (pin& x : qab[0]) {

		c ^= ((2 * x.first + x.second)%3+1);

	}

	if (!c) {

		pin ans = solve(qab[1], ex - 1);

		ans.first *= 2; ans.second *= 2; ans.second++;

		return ans;

	}

	pin ans = solve(qab[0], ex - 1);

	c = 0;

	int d = 0;

	for (pin& x : qab[1]) {

		int w = ans.second - x.second - 1;

		if ((w & x.first) == w) { c ^= 1; }

		w++;

		if ((w & x.first) == w) { d ^= 1; }

	}

	ans.first *= 2; ans.second *= 2;

	ans.first += (c | d); ans.second -= c;

	return ans;

}

signed main() {

	cin.tie(0); ios::sync_with_stdio(false);

	long long inf = 1e17;

	int n; cin >> n;

	V<pin> ab(n);

	rep(i, n) {

		long long a, b; cin >> a >> b;

		ab[i] = { a + inf,b + inf };

	}

	pin ret = solve(ab, 59);

	cout << ret.first - inf << " " << ret.second - inf << "\n";

}