#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int MOD = 1000000 + 3;
int mul(ll a, ll b) { return (a * b) % MOD; }
int inv(int x) {
  const int y = MOD - 2;
  int ret = 1, base = x;
  for (int i = 0; y >> i; i++) {
    if ((y >> i) & 1) ret = mul(ret, base);
    base = mul(base, base);
  }
  return ret;
}
int ask(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  int fx;
  scanf("%d", &fx);
  if (fx == -1) exit(0);
  return fx;
}
const int N = 11;
int a[N][N], b[N];
int c[N];
void add(int s, int t, int k) {
  for (int j = 0; j < N; j++) {
    a[t][j] += mul(a[s][j], k);
    a[t][j] %= MOD;
  }
  b[t] += mul(b[s], k);
  b[t] %= MOD;
}
void swapl(int s, int t) {
  for (int j = 0; j < N; j++) swap(a[s][j], a[t][j]);
  swap(b[s], b[t]);
}
int main() {
  for (int i = 0; i < N; i++) {
    b[i] = ask(i);
    int pwr = 1;
    for (int j = 0; j < N; j++) {
      a[i][j] = pwr;
      pwr = mul(pwr, i);
    }
  }
  for (int i = 0; i < N; i++) {
    int i2 = i;
    while (i2 < N and a[i2][i] == 0) i2++;
    assert(i2 < N);
    if (i != i2) swapl(i, i2);
    int inverse = inv(a[i][i]);
    for (i2 = i + 1; i2 < N; i2++) {
      if (a[i2][i] == 0) continue;
      int m = mul(inverse, a[i2][i]);
      add(i, i2, MOD - m);
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    int inverse = inv(a[i][i]);
    for (int i2 = i - 1; i2 >= 0; i2--) {
      int m = mul(inverse, a[i2][i]);
      add(i, i2, MOD - m);
    }
  }
  for (int i = 0; i < N; i++) {
    c[i] = mul(b[i], inv(a[i][i]));
  }
  for (int x = 0; x < MOD; x++) {
    int pwr = 1;
    int fx = 0;
    for (int j = 0; j < N; j++) {
      fx += mul(c[j], pwr);
      fx %= MOD;
      pwr = mul(pwr, x);
    }
    if (fx == 0) {
      printf("! %d\n", x);
      fflush(stdout);
      return 0;
    }
  }
  printf("! -1\n");
  fflush(stdout);
  return 0;
}
