#include <bits/stdc++.h>
using namespace std;
const long N = 1e6;
const long mod = 1e6 + 3;
const long long int PI = acos(-1);
const long long int eps = 1e-12;
const int inf = 2000000000;
const long long int infLL = (long long int)1e18;
long long int MOD = 1e6 + 3;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
inline bool checkBit(long long int n, long long int i) {
  return n & (1LL << i);
}
inline long long int setBit(long long int n, long long int i) {
  return n | (1LL << i);
  ;
}
inline long long int resetBit(long long int n, long long int i) {
  return n & (~(1LL << i));
}
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(long long int a, long long int b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long int &a) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline long long int modMul(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a * b) % MOD;
}
inline long long int modAdd(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a + b) % MOD;
}
inline long long int modSub(long long int a, long long int b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long int modPow(long long int b, long long int p) {
  long long int r = 1LL;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1LL;
  }
  return r;
}
inline long long int modDiv(long long int a, long long int b) {
  return modMul(a, modPow(b, MOD - 2));
}
void gauss(vector<vector<long long int> > A, vector<long long int> &x) {
  int n = A.size();
  for (int i = 0; i < n; i++) {
    long long int maxEl = abs(A[i][i]);
    int maxRow = i;
    for (int k = i + 1; k < n; k++) {
      if (abs(A[k][i]) > maxEl) {
        maxEl = abs(A[k][i]);
        maxRow = k;
      }
    }
    for (int k = i; k < n + 1; k++) {
      long long int tmp = A[maxRow][k];
      A[maxRow][k] = A[i][k];
      A[i][k] = tmp;
    }
    for (int k = i + 1; k < n; k++) {
      long long int c = modDiv(A[k][i], A[i][i]) * (-1);
      c = (c + MOD) % MOD;
      for (int j = i; j < n + 1; j++) {
        if (i == j) {
          A[k][j] = 0;
        } else {
          A[k][j] += modMul(c, A[i][j]);
          A[k][j] += MOD;
          A[k][j] %= MOD;
        }
      }
    }
  }
  x.resize(n);
  for (int i = n - 1; i >= 0; i--) {
    x[i] = modDiv(A[i][n], A[i][i]);
    for (int k = i - 1; k >= 0; k--) {
      A[k][n] = modSub(A[k][n], modMul(A[k][i], x[i]));
    }
  }
}
long long int eval(long long int x, vector<long long int> ans) {
  long long int p = 1, sum = 0;
  for (long long int i = 0; i <= 10; i++) {
    sum = (sum + p * ans[i]) % mod;
    p = (p * x) % mod;
  }
  return sum;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<vector<long long int> > a;
  vector<long long int> ans, v;
  for (long long int i = 0; i <= 10; i++) {
    v.clear();
    long long int p = 1;
    for (long long int j = 0; j <= 10; j++) {
      v.push_back(p);
      p = (p * i) % mod;
    }
    cout << "? " << i << endl;
    long long int x;
    cin >> x;
    v.push_back(x);
    a.push_back(v);
  }
  gauss(a, ans);
  for (long long int i = 0; i < mod; i++) {
    if (!eval(i, ans)) cout << "! " << i << endl, exit(0);
  }
  cout << "! " << -1 << endl;
  return 0;
}
