// Arup Guha
// 11/11/2017
// Solution to 2017 SER D1 and D2 Problem: Star Arrangements

import java.util.*;

public class star {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();

		// Try number of stars in the first row.
		for (int i=2; i<=n/2+1; i++) {

			// i, i-1 case.
			if (n%(2*i-1) == 0 || n%(2*i-1) == i)
				System.out.println(i+" "+(i-1));

			// i, i case.
			if (n%i == 0)
				System.out.println(i+" "+i);
		}
	}
}