#include <iostream>#include <cmath>using namespace std;int main(){int testcase, i, num, o, p, temp;cin >> testcase;for (i = 0; i < testcase; i++){bool tag = false;cin >> num;for (o = 1; o <= 1000000; o += 2){if (tag)break;for (p = 0; p < 30; p++){temp = o * pow(2, double (p));if (temp == num){cout << o << " " << p << endl;tag = true;break;}}}}}


