// 1. 注意数据类型要选择double
// 2. 下一个全排列 next_permutation的使用
#include <algorithm>
#include<iostream>
#include <vector>
using namespace std;
vector<char> op{'+', '-', '*', '/'};
double cal(double a, double b, char ch){
switch (ch) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
}
return 0;
}
int main(){
vector<double> v(4);
cin >> v[0] >> v[1] >> v[2] >> v[3];
sort(v.begin(), v.end());
do{
for(int i = 0; i < 4; ++i){
for(int j = 0; j < 4; ++j){
for(int k = 0; k < 4; ++k){
double tmp = 0;
tmp = cal(v[0], v[1], op[i]);
tmp = cal(tmp, v[2], op[j]);
tmp = cal(tmp, v[3], op[k]);
if(tmp == 24){
cout << "true" << endl;
return 0;
}
}
}
}
}while(next_permutation(v.begin(), v.end()));
cout << "false" << endl;
return 0;
}