A, B = gets.split.map &:to_i puts (1..600).select { |i| [i % 5, i - 5 * B].max <= A } .sort