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

#define MAX 100000LL

int *nb = 0;

int main() {
	nb = (int*)malloc(MAX * sizeof(*nb));
	memset(nb, 0, MAX * sizeof(*nb));

	long long a2;
	for (long long a=0; (a2=a*a)<MAX; a++) {
		long long a2b2;
		for (long long b=0; b<=a && (a2b2=a2+b*b)<MAX; b++) {
			long long w0 = (a?2:1) * (b?2:1) * (a==b?1:2);
			long long w = 2*w0;

			long long n;
			for (long long c=0; (n=a2b2+5*c*c)<MAX; c++) {
				nb[n]+= w0;
				w0 = w;
			}
		}
	}

	int k = 0;
	int m = 0;
	for (int n=0; n<MAX; n++) {
		if (m<nb[n]) {
			k++;
			m=nb[n];
			printf("%d %d\n", k, m);
			fflush(stdout);
		}
	}

	free(nb);
	nb = 0;

	return 0;
}