#include #include #include #include #include #include #include // #include "Src/Utility/BinarySearch.hpp" // #include "Src/Sequence/CompressedSequence.hpp" // #include "Src/Sequence/RunLengthEncoding.hpp" // using namespace zawa; // #include "atcoder/modint" // using mint = atcoder::modint998244353; using i128 = __int128_t; void solve(long long N) { long long mbit = 1; while (mbit <= N) mbit <<= 1; mbit >>= 1; i128 ans = (i128)mbit * (N - mbit); long long X = mbit, Y = (N - mbit); if (N >= 4) { mbit >>= 1; if (ans < (i128)mbit * ((mbit << 1) - 1 - mbit)) { X = mbit; Y = (mbit << 1) - 1 - mbit; } } std::cout << X << ' ' << Y << '\n'; } int main() { std::cin.tie(nullptr); std::cout.tie(nullptr); std::ios::sync_with_stdio(false); int T; std::cin >> T; while (T--) { long long N; std::cin >> N; solve(N); } }