module Memoizable
	def memoize(name)
		original = "__original_#{name}__"
		([Class, Module].include?(self.class) ? self : self.class).class_eval {
			alias_method(original, name)
			private(original)
			cache = {}
			define_method(name){|*args|
				cache[args] ||= send(original, *args)
			}
		}
	end 
end
include Memoizable 

def f(x, y, z, carry, i)
	if i > x.size
		return carry == 0 ? 1 : 0
	end

	a = (x[-i] == ?? ? (0..9).to_a : [x[-i].to_i])
	a.delete(0) if i == x.size
	b = (y[-i] == ?? ? (0..9).to_a : [y[-i].to_i])
	b.delete(0) if i == y.size
	c = (z[-i] == ?? ? (0..9).to_a : [z[-i].to_i])
	c.delete(0) if i == z.size

	sum = 0
	a.each do |u|
		b.each do |v|
			c.each do |w|
				o = u + v - w + carry
				next if o % 10 > 0
				sum += f(x, y, z, o / 10, i + 1)
			end
		end
	end

	sum % 1_000_000_007
end

memoize :f

loop do
	x = gets.chomp
	break if x == "0"
	y = gets.chomp
	z = gets.chomp
	p f(x, y, z, 0, 1)
end