count = STDIN.read.to_i (0..count).reduce([]) do |ret, two| ret << 2 ** two count.times.reduce(ret) do |ret2, five| ret2 << ret2[-1] * 5 end end.sort.uniq.each do |val| puts val end