#include <stdio.h>
#include <iostream>
#include <math.h>

int main()
{
	int k,i;
	bool factorfound;
	for (int n=2; n<=20; n++) {
		k = floor(sqrt(n));
		i = 2;
		factorfound = false;
		while (!factorfound && i<=k) {
			if (n%i==0) factorfound=true;
			i++;
		}
		if (factorfound) std::cout << n << " is composite\n"; else std::cout << n << " is prime\n";
	}
}