import java.io.*;

public class Q3 {
	public String s;
	
	public static void main(String args[]) throws IOException {
		BufferedReader readFile = new BufferedReader(new FileReader("DATA3.txt"));
		PrintWriter fileOut = new PrintWriter(new FileWriter("OUT3.txt"));
		int parameters[] = new int[5];
		
		for (int c = 0; c < 5; c++) {
			parameters[c] = Integer.parseInt(readFile.readLine());
		}
		
		for (int c = 0; c < 5; c++) {
			if ((Math.pow(parameters[c], 1.0/3.0) - Math.round(Math.pow(parameters[c], 1.0/3.0))) < 0.01) {
				fileOut.println(Math.round(Math.pow(parameters[c], 1.0/3.0))*Math.round(Math.pow(parameters[c], 1.0/3.0))*6);
			} else {
				fileOut.println("46");
			}
		}
		fileOut.close();
	}
}
