require 'prime'
loop do
  n, p = gets.split.map(&:to_i)
  break if n == -1
  p Prime.each.lazy.drop_while{ |e| e <= n }.take(p/2).to_a.repeated_combination(2).to_a.map{ |a| a.reduce(:+) }.sort[p-1]
end