pi = gets.strip a = [20105, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841] pi.each_char do |c| a[c.to_i] -= 1 end 10.times do |i| print i, " " if a[i] == -1 end 10.times do |i| print i, "\n" if a[i] == 1 end