A, B = gets.split.map(&:to_i) dp = Array.new(610, 0) (0 .. A).each do |a| (0 .. B).each do |b| dp[a + 5 * b] += 1 end end puts dp.each_index.select{|i| i > 0 && dp[i] > 0 }