#include #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define ALL(v) v.begin(), v.end() using namespace std; using P = pair; typedef long long ll; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; int main() { ll a, b, c; cin >> a >> b >> c; ll g = gcd(a, gcd(b, c)); if(g != 1){ cout << "INF" << endl; return 0; } if(a == 1 || b == 1 || c == 1){ cout << 0 << endl; return 0; } }