/*
 * Equiperdida
 * Tempo: 275 ms
 * */

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

public class portas5 {

	public static void main(String[] args){

        long tempoInicial = System.currentTimeMillis();

        BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in)) ;
        String entrada1 = "";
        int portas=-1;

        try{
			while (true){

            	entrada1 = entrada.readLine();
                portas = Integer.parseInt(entrada1);

                if (portas==0){
           	        long tempoFinal = System.currentTimeMillis();

					System.out.println( tempoFinal - tempoInicial );

                	System.exit(0);
                }

                System.out.print("1");

				if (portas>1){
					for(int cont=2;(cont*cont)<=portas;cont++){
                   		System.out.print(" "+(cont*cont));
					}
				}

                System.out.println("");
			}
        }
		catch (Exception e){
            System.out.println(e);
            System.exit(0);
        }
    }
}
