[[[
#include<iostream>
int cnt = 1;
int main(void)
{
#include<iostream>
int cnt = 1;
int main(void)
{
int n;
int ans1 = 0, ans2 = 0, sum = 0;
scanf("%d", &n);
while(1){
ans1 = cnt;
ans2 = -1;
while(cnt > 0 && sum != n){
printf("%d %d", ans1, ans2);
}int ans1 = 0, ans2 = 0, sum = 0;
scanf("%d", &n);
while(1){
if(n <= cnt)break;
cnt = cnt * 2;
}cnt = cnt * 2;
ans1 = cnt;
ans2 = -1;
while(cnt > 0 && sum != n){
if(sum + cnt <= n)sum += cnt;
cnt = cnt /2;
ans2++;
}cnt = cnt /2;
ans2++;
printf("%d %d", ans1, ans2);
]]]