/*
 * Equiperdida
 *
 * Tempo: 285 ms
 */

import java.io.InputStreamReader;
import java.io.BufferedReader;

public class portas4 {
		public static void main(String[] args){

	        long tempoInicial = System.currentTimeMillis();

	        BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in)) ;
	        String entrada1 = "";
                int portas=-1;
	        //String temp[];
                try{
                    while (portas!=0){
                        entrada1 = entrada.readLine();
                        portas = Integer.parseInt(entrada1);
                        if (portas==0){
                        	long tempoFinal = System.currentTimeMillis();

							System.out.println( tempoFinal - tempoInicial );

                            System.exit(0);
                        }
                        int cont=1;
                        System.out.print("1");
                        while (true){
                            cont++;
                            if (cont*cont<=portas){
                                System.out.print(" "+cont*cont);
                            }
                            else{
                                System.out.println("");
                                break;
                            }
                        }
                    }
                    System.exit(0);
                }
                catch (Exception e){
                    System.out.println(e);
                    System.exit(0);
                }
    }
}
