# # Код на ruby 2.2.3p173
def calculate(a, b)
while (b>0)
a = a * (b % 10)
b = b / 10
end
return a
end
def zadanie()
args = []
File.open("input.txt", "r") do |file|
line = file.gets
line.split(" ").each {|t| args<<t.to_i}<br> end
File.open("output.txt", "w") do |file|
file.puts "#{calculate(args[0], args[1])}"
end
end
# # Примеры применения
zadanie()