import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/*
 * Created on Dec 12, 2007
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author 309245306
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Question1 {
	
	public static void main(String[] args)throws Exception {
		
		
		
		String input1;
		int inputint;
		int y;
		FileInputStream File1; // create a file input object 
		DataInputStream In; // create an Input stream object 
		String fileInput = ""; // create string to store data 
		// Create a new file input stream connected to "data1" 
		File1 = new FileInputStream("DATA1.txt");  
		In = new DataInputStream (File1); // Connect DataInputStream to the File object
		FileOutputStream fileHandle; // create a file object
		PrintWriter outputFile; // create a print writer object
		// Create a new file output stream that is 
		// connected to "data.txt"
		String fileName="OUT1.txt"; 
		fileHandle = new FileOutputStream(fileName);
		// Connect print writer to the output stream
		outputFile = new PrintWriter(fileHandle);
		
		
		String outthis="valid";
		
		for (int x=0;In. available() > 0;x++)   { 
			int true1=0;
			int true2=0;
			int true3=0;
			int valid=0;
			fileInput = In.readLine(); 
			input1=fileInput;
			inputint=Integer.parseInt(input1);
			
			for(int b=2;b<1000;b++){
				
				if(valid==1){
					break;
				}
				
				if (inputint%b==0){
					inputint=inputint/b;
					if (true1==0){
						true1=b;
				
					}
					else if((true2==0)&&(true2!=true1)){
						true2=b;
				
					}
					else if((true3==0)&&(true3!=true1)&&(true3!=true2)){
						true3=b;
						
					}
					if ((true1!=0)&&(true2!=0)&&(true3!=0)){
						valid=1;
					}
					
					for(int z=2;z<=inputint;z++){
						
						if(valid==1){
							break;
						}
						
						
					}
				}
				
				
				
			} 
			if(valid==1){
				outputFile.println (outthis); 
				
			}
			else{
				outputFile.println ("not"); 
			}
		}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		In.close(); 
		outputFile.close();
	}
}

