#include <iostream>
#include <algorithm>
using namespace std;
bool EstePrim(int n);
int main()
{
int a, b;
cin >> a >> b;
int sum1 = 0;
while (a)
{
sum1 += a % 10;
a /= 10;
}
int sum2 = 0;
while (b)
{
sum2 += b % 10;
b /= 10;
}
if (EstePrim(sum1) && EstePrim(sum2))
cout << "da sunt prime";
else
cout << "nu sunt prime";
}
bool EstePrim(int n)
{
if (n < 2) return false;
if (n == 2) return true;
if (n % 2 == 0)
return false;
for (int d = 3; d * d <= n; d += 2)
if (n % d == 0)
return false;
return true;
}