#include <bits/stdc++.h>
using namespace std;
const int N = 11, mod = 1e6 + 3;
inline int pw(int x, int y) {
  int ret = 1;
  for (; y; y /= 2) {
    if (y & 1) ret = 1ll * ret * x % mod;
    x = 1ll * x * x % mod;
  }
  return ret;
}
int a[N][N + 1], ans[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < N; i++) {
    for (int j = 0, cur = 1; j < N; j++, cur = cur * i % mod) {
      a[i][j] = cur;
    }
    cout << "? " << i << endl;
    cin >> a[i][N];
  }
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      int mul = 1ll * pw(a[i][i], mod - 2) * a[j][i] % mod;
      for (int k = 0; k <= N; k++) {
        a[j][k] -= (1ll * a[i][k] * mul) % mod;
        if (a[j][k] < 0) a[j][k] += mod;
      }
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    int nw = a[i][N];
    for (int j = N - 1; j > i; j--) {
      nw -= 1ll * a[i][j] * ans[j] % mod;
      if (nw < mod) nw += mod;
    }
    ans[i] = 1ll * nw * pw(a[i][i], mod - 2) % mod;
  }
  for (int i = 0; i < mod; i++) {
    int nw = 0;
    for (int j = 0; j < N; j++) {
      nw += 1ll * pw(i, j) * ans[j] % mod;
      if (nw >= mod) nw -= mod;
    }
    if (nw == 0) return cout << "! " << i << endl, 0;
  }
  cout << "! -1" << endl;
  return 0;
}
