#include <iostream>
#include <cmath>
using namespace std;


bool isPrime(int n)
{
	// ����� �� �������� ����� �� ���������� � > 1 ;)
	if (n < 2)
		return false;
	// ���� ������� ������ � ������ �����
	if (n%2 == 0)
		return false;
	// ��� �� � �����, ����� ���� � ����� ��������...
	for (int divisor = 3;divisor <= sqrt((double)n); divisor+= 2)
	{
		if (n%divisor == 0)
			// ���� ��� ������� � �� � ������....
			return false;
	}

	return true;
}

int fibNum(int n)
{
	if (n < 0)
		return -1;
	int preLast = 0;
	int last = 1;
	if (n == 0)
		return preLast;
	if (n == 1)
		return last;
	int current;
	for (int i=2;i<=n;i++)
	{
		current = preLast + last;
		preLast = last;
		last = current;
	}
	return current;
}


int main (void)
{
	int n;
	cin>>n;
	cout<<n;
	switch (isPrime(n))
	{
		case 0:
		{
			cout<<" is not prime !"<<endl;
			break;
		}
		case 1:
		{
			cout<<" is prime !"<<endl;
			break;
		}
	}

	int fibN;
	cin>>fibN;
	cout<<fibNum(fibN);
}