#include <bits/stdc++.h>
using namespace std;
#define int long long
#define CALL(a,b,carry,c) // cerr << "i=" << i << " a=" << a << " b=" << b << " carry=" << carry << " c=" << c << endl
const int MOD = (int)1000000007;
string A, B, C;
int NA, NB, NC;
int dp[51][2];
int solve(int i, int carry) {
  if(i >= max({NA, NB, NC})) return carry == 0 ? 1 : 0;
  int &ret = dp[i][carry];
  if(ret != -1) return ret;
  ret = 0;
  int a, b;
  if(i < NC && C[i] == '?') {
    if (i >= NA) {
      a = 0;
      if(i >= NB) {
        b = 0;
        CALL(a,b,carry,'?');
        ret += solve(i + 1, (a + b + carry) / 10);
        ret %= MOD;
      }
      else if(B[i] != '?') {
        b = B[i] - '0';
        CALL(a,b,carry,'?');
        ret += solve(i + 1, (a + b + carry) / 10);
      }
      else {
        int bstart = (i == NB - 1) ? 1 : 0;
        for(b = bstart; b <= 9; ++b) {
          CALL(a,b,carry,'?');
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
    }
    else if(A[i] != '?') {
      a = A[i] - '0';
      if(i >= NB) {
        b = 0;
        CALL(a,b,carry,'?');
        ret += solve(i + 1, (a + b + carry) / 10);
        ret %= MOD;
      }
      else if(B[i] != '?') {
        b = B[i] - '0';
        CALL(a,b,carry,'?');
        ret += solve(i + 1, (a + b + carry) / 10);
        ret %= MOD;
      }
      else {
        int bstart = (i == NB - 1) ? 1 : 0;
        for(b = bstart; b <= 9; ++b) {
          CALL(a,b,carry,'?');
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
    }
    else {
      int astart = (i == NB - 1) ? 1 : 0;
      for(a = astart; a <= 9; ++a) {
        if(i >= NB) {
          b = 0;
          CALL(a,b,carry,'?');
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
        else if(B[i] != '?') {
          b = B[i] - '0';
          CALL(a,b,carry,'?');
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
        else {
          int bstart = (i == NB - 1) ? 1 : 0;
          for(b = bstart; b <= 9; ++b) {
            CALL(a,b,carry,'?');
            ret += solve(i + 1, (a + b + carry) / 10);
            ret %= MOD;
          }
        }
      }
    }
  }
  else {
    int c = (i >= NC) ? 0 : C[i] - '0';
    if (i >= NA) {
      a = 0;
      if(i >= NB) {
        b = 0;
        if((a + b + carry) % 10 == c) {
          CALL(a,b,carry,c);
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
      else if(B[i] != '?') {
        b = B[i] - '0';
        if((a + b + carry) % 10 == c) {
          CALL(a,b,carry,c);
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
      else {
        int bstart = (i == NB - 1) ? 1 : 0;
        for(b = bstart; b <= 9; ++b) {
          if((a + b + carry) % 10 == c) {
            CALL(a,b,carry,c);
            ret += solve(i + 1, (a + b + carry) / 10);
            ret %= MOD;
          }
        }
      }
    }
    else if(A[i] != '?') {
      a = A[i] - '0';
      if(i >= NB) {
        b = 0;
        if((a + b + carry) % 10 == c) {
          CALL(a,b,carry,c);
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
      else if(B[i] != '?') {
        b = B[i] - '0';
        if((a + b + carry) % 10 == c) {
          CALL(a,b,carry,c);
          ret += solve(i + 1, (a + b + carry) / 10);
          ret %= MOD;
        }
      }
      else {
        int bstart = (i == NB - 1) ? 1 : 0;
        for(b = bstart; b <= 9; ++b) {
          if((a + b + carry) % 10 == c) {
            CALL(a,b,carry,c);
            ret += solve(i + 1, (a + b + carry) / 10);
            ret %= MOD;
          }
        }
      }
    }
    else {
      int astart = (i == NB - 1) ? 1 : 0;
      for(a = astart; a <= 9; ++a) {
        if(i >= NB) {
          b = 0;
          if((a + b + carry) % 10 == c) {
            CALL(a,b,carry,c);
            ret += solve(i + 1, (a + b + carry) / 10);
            ret %= MOD;
          }
        }
        else if(B[i] != '?') {
          b = B[i] - '0';
          if((a + b + carry) % 10 == c) {
            CALL(a,b,carry,c);
            ret += solve(i + 1, (a + b + carry) / 10);
            ret %= MOD;
          }
        }
        else {
          int bstart = (i == NB - 1) ? 1 : 0;
          for(b = bstart; b <= 9; ++b) {
            if((a + b + carry) % 10 == c) {
              CALL(a,b,carry,c);
              ret += solve(i + 1, (a + b + carry) / 10);
              ret %= MOD;
            }
          }
        }
      }
    }
  }
  return ret;
}
signed main() {
  while(true) {
    cin >> A;
    if(A == "0") break;
    cin >> B >> C;
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    reverse(C.begin(), C.end());
    NA = A.size(), NB = B.size(), NC = C.size();
    memset(dp, -1, sizeof(dp));
    cout << solve(0, 0) << endl;
  }
}

Measured memory_bytes: 1192