import java.util.*;
public class ProblemE
{
	private static Map<String,Long> memo = new HashMap<String,Long>();
	private static long calcPerm(int num,int start)
	{
		if(memo.containsKey(""+num+" "+start))
			return memo.get(""+num+" "+start);
		long perms = 1;
		int base = num/2;
		for(int x=start;x<=base;x++)
		{
			int middle = num-(2*x);
			if(middle>x)
				perms += calcPerm(middle,x);
			else if(middle == 0 || middle==x)
				perms++;
		}
		if(!memo.containsKey(num))
			memo.put(""+num+" "+start,perms);
		return perms;
	}
	public static void main (String [] args)
	{
		Scanner in = new Scanner(System.in);
		int num = Integer.parseInt(in.nextLine());
		while(num > 0)
		{
			long perms = 0;
			perms = calcPerm(num,1);
			System.out.println(num + " " + perms);
			num = Integer.parseInt(in.nextLine());
		}
	}
}
