#include #include #include #include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; using vi = vector; using vvi = vector; using vvvi = vector; using vll = vector; using vvll = vector; using vvvll = vector; using vmi = vector; using vvmi = vector; using vvvmi = vector; #define all(a) (a).begin(), (a).end() #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int t; cin >> t; while(t--){ ll n; cin >> n; bitset<64> bs(n); bitset<64> x, y; bool f = true; drep(i, 64){ if(bs[i]){ if(f){ x.set(i); }else{ y.set(i); } f = false; } } cout << x.to_ullong() << " " << y.to_ullong() << endl; } return 0; }