#include using namespace std; #define int long long int T; signed main(){ cin>>T; for(int i = 0; i < T; i++){ int N; cin>>N; int cnt = 1; for(int i = 0; cnt*2 < N; i++){ cnt *= 2; } int S = N; if(cnt * 2 == N) S = N-1; int x0 = cnt; int y0 = S-cnt; int a0 = x0*y0; int x1 = cnt/2; int y1 = cnt/2-1; int a1 = x1*y1; if(N == 0) cout << "0 0" << endl; else if(N == 1) cout << "1 0" << endl; else if(N == 2) cout << "2 0" << endl; else if(a0 >= a1) cout << x0 << " " << y0 << endl; else cout << x1 << " " << y1 << endl; } }