def is_kadomatsu(a, b, c): ans = False if b == min(a, b, c) or b == max(a, b, c): if a != b and b != c and c != a: ans = True return ans A = list(map(int, input().split())) if is_kadomatsu(*A): print('INF') else: cnt = 0 for i in range(1, max(A) + 1): B = [x % i for x in A] if is_kadomatsu(*B): cnt += 1 print(list(B)) print(cnt)