#include <iostream>
#include <cmath>
#include <iomanip>
bool zad1(int N)
{
int sum = 0;
while(N > 0)
{
sum += N % 10;
N /= 10;
}
return sum % 2 == 0;
}
bool zad2(int N)
{
int sum = 0, tmp = N;
while(N > 0)
{
sum += N % 10;
N /= 10;
}
return std::pow(tmp, 2) == std::pow(sum, 3);
}
bool zad3(int a, int b, int c)
{
return (a == b && b != c) || (a == c && a != b);
}
int main()
{
int N, a, b, c;
std::cin >> N >> a >> b >> c;
std::cout.std::ios_base::setf(std::ios_base::boolalpha);
std::cout << zad1(N) << std::endl
<< zad2(N) << std::endl
<< zad3(a, b, c) << std::endl;
return 0;
}