#include <stdio.h>
#include <string.h>

#define MAX (100000+1)

int A302128[MAX];
int A005350[MAX];

int main() {
	memset(A302128, 0, sizeof(A302128));
	memset(A005350, 0, sizeof(A005350));

	for (int n=1; n<MAX; n++) {
		if (n<=3) {
			A302128[n] = 1;
			A005350[n] = 1;
		} else {
			A302128[n] = A302128[A302128[n-2]] + A302128[n-A302128[n-1]];
			A005350[n] = A005350[A005350[n-1]] + A005350[n-A005350[n-1]];
		}
	}

	int *x = &A302128[0];
	int *y = &A005350[0];

	for (int n=1; n<MAX; n++) {
		printf ("%d %d\n", n, x[y[n]] - y[x[n]]);
	}

	return 0;
}