require 'set' def dfs(xs) if xs.size == 1 x = xs[0] if x.denominator == 1 and x >= 0 Set.new [x.to_i] else Set.new [] end else a = Set.new x = xs.shift y = xs.shift can = [] can << x + y can << x - y can << y - x can << x * y can << y / x if x != 0 can << x / y if y != 0 can.each do |z| a += dfs([z] + xs) end a end end def solve(n) a = (1..n).to_a.map { |i| Rational(i, 1) } dfs(a).to_a.sort end m, n = gets.chomp.split.map(&:to_i) puts m < 3 && n == 0 ? :Impossible : :Possible