#include using namespace std; using ll = long long; void solve() { ll n; cin >> n; if (n == 0) { cout << "0 0\n"; return; } ll x = (1ll << (63 - __builtin_clzll(n))); cout << x << ' ' << n - x << '\n'; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int q; cin >> q; while (q--) { solve(); } return 0; }