require 'prime' y, x = gets.split.map(&:to_i) if Prime.prime?(x) && Prime.prime?(y) puts :Second exit end if Prime.prime?(x) || Prime.prime?(y) x, y = y, x if Prime.prime?(y) if Prime.prime?(x + 1) puts :Second exit end end a = (y + 1...Float::INFINITY).find { |i| Prime.prime?(i) } b = (x + 1...Float::INFINITY).find { |i| Prime.prime?(i) } c = a - y d = b - x puts [:Second, :First][c + d & 1]