require 'json'
data = JSON.parse(gets)
gatya =[]
9.times do
num = rand(100)
if num < 10
puts data["2"]
gatya.push(data["2"])
elsif num < 30
puts data["1"]
gatya.push(data["1"])
else
puts data["0"]
gatya.push(data["0"])
end
end
if gatya.include?(data["2"])
num = rand(100)
if num < 10
puts data["2"]
gatya.push(data["2"])
elsif num < 30
puts data["1"]
gatya.push(data["1"])
else
puts data["0"]
gatya.push(data["0"])
end
else
puts data["2"]
end