#include #include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ ll n; cin >> n; if(n == 0){ cout << "0 0\n"; continue; } __int128 mx = 0; ll x1 = 1ll << __lg(n), y1 = n - x1; n = (1ll << __lg(n)) - 1; ll x2 = 1ll << __lg(n), y2 = n - x2; if(__int128(x1) * y1 > __int128(x2) * y2){ cout << x1 << ' ' << y1 << '\n'; }else{ cout << x2 << ' ' << y2 << '\n'; } } }