//#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int a,b,c; cin >> a >> b >> c; if(__gcd(a,b)!=1 and __gcd(b,c)!=1 and __gcd(c,a)!=1 and __gcd(__gcd(a,b),c)!=1){ printf("INF\n"); } else{ const int N=10000000; vector dp(N,false); dp[a]=true; dp[b]=true; dp[c]=true; int res=0; for(int i=1;i