public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input = new Scanner(System.in);
		ArrayList<Integer> numList = new ArrayList<Integer>();

		do {
			numList.add(input.nextInt());
		} while (numList.get(numList.size()-1) != 0);

		numList.remove(numList.size()-1);

		for (int i = 0; i < numList.size(); i++) {
			boolean prime = true;
			boolean perfect = true;

			int number = numList.get(i);
			prime = isPrime(number);
			perfect = isPerfect(number, prime);


			if(!prime && !perfect)
				System.out.println("Dull");
			else if(prime && !perfect)
				System.out.println("Prime");
			else if(!prime && perfect)
				System.out.println("Perfect");
			else
				System.out.println("This program doesn't work");
		}
		return;
	}