#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define MOD 1000000007
typedef long long ll;

int main()
{
	while (1)
	{
		string A, B, C;
		cin >> A;
		if (A.length() == 1 && A[0] == '0') return 0;
		cin >> B >> C;

		ll ans = 1;
		ll plus1 = 0;
		rrep(i, A.length() - 1, 0)
		{
			ll n_ans = 0, n_plus1 = 0;

			rep(a, 0, 10)
			{
				int aa;
				if (i != 0)
				{
					if (A[i] != '?')
					{
						if (a > 0) break;
						aa = A[i] - '0';
					}
					else
					{
						aa = a;
					}
				}
				else
				{
					if (a == 0) continue;
					if (A[i] != '?')
					{
						if (a > 1) break;
						aa = A[i] - '0';
					}
					else
					{
						aa = a;
					}
				}

				rep(b, 0, 10)
				{
					int bb;
					if(i != 0)
					{
						if (B[i] != '?')
						{
							if (b > 0) break;
							bb = B[i] - '0';
						}
						else
						{
							bb = b;
						}
					}
					else
					{
						if (b == 0) continue;
						if (B[i] != '?')
						{
							if (b > 1) break;
							bb = B[i] - '0';
						}
						else
						{
							bb = b;
						}
					}

					rep(ii, 0, 2)
					{
						int sum = aa + bb + ii;
						
						int cc = sum % 10;
						if (C[i] != '?')
						{
							int c = C[i] - '0';
							if (c != cc) continue;
						}

						if (ii == 0)
						{
							if (10 <= sum)
								n_plus1 += ans;
							else
								n_ans += ans;
						}
						else
						{
							if (10 <= sum)
								n_plus1 += plus1;
							else
								n_ans += plus1;
						}
					}
				}
			}

			ans = n_ans % MOD;
			plus1 = n_plus1 % MOD;
		}

		cout << ans << endl;
	}
}