//https://ncode.syosetu.com/n4830bu/303/ #include using namespace std; #include using boost::multiprecision::cpp_int; cpp_int maine(int L) { cpp_int a = 1, b = 1, c = 1, d = 0, maine = 1, book = 1; if (L <= 2) return 1; L -= 2; while (L) { if (L & 1) { cpp_int tmp = a * maine + b * book; book = c * maine + d * book; maine = tmp; } cpp_int A, B, C, D; A = a * a + b * c; B = b * (a + d); C = c * (a + d); D = b * c + d * d; a = A; b = B; c = C; d = D; L >>= 1; } return maine; } int main() { int L; cin >> L; if (L == 2) cout << "INF" << endl << 0 << endl; else cout << L << endl << maine(L) - !(L & 1) * maine(L / 2) * maine(L / 2) << endl; }