#include<bits/stdc++.h> using namespace std; int i=80000; int main(){ while(i%37!=8||i%59!=13||i%71!=23){ i++; } cout<<i; return 0; }