#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
int zerobuffer[100];
int onebuffer[100];
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
int n;
cin >> n;
zerobuffer[0] = 1;
onebuffer[1] = 1;
for (int i = 2; i < 50; i++)
{
zerobuffer[i] = zerobuffer[i-1] + zerobuffer[i-2];
onebuffer[i] = onebuffer[i-1]+ onebuffer[i-2];
}
for (int i = 0; i < n; i++)
{
int ca;
cin >> ca;
cout << zerobuffer[ca] << ' ' << onebuffer[ca]<< '\n';
}
return 0;
}