#include <bits/stdc++.h>
using namespace std;
const int N = 20;
const int MOD = 1e6 + 3;
int a[N];
struct PolyInter {
  int y[N], k, finv[N];
  int l[N], r[N];
  void init(int n, int Y[]) {
    memcpy(y, Y, sizeof(int) * (n + 2));
    k = n;
    finv[0] = finv[1] = 1;
    for (int i = 2; i <= k; i++) {
      finv[i] = 1LL * (MOD - MOD / i) * finv[MOD % i] % MOD;
    }
    int tmp = 1;
    for (int i = 2; i <= k; i++) {
      tmp = 1LL * tmp * i % MOD;
      finv[i] = 1LL * finv[i] * finv[i - 1] % MOD;
    }
  }
  int calc(long long x) {
    int ret = 0, cur = 0;
    l[0] = r[k + 1] = 1;
    for (int i = 1; i <= k; i++) {
      l[i] = 1LL * l[i - 1] * (x - i + MOD) % MOD;
    }
    for (int i = k; i > 0; i--) {
      r[i] = 1LL * r[i + 1] * (x - i + MOD) % MOD;
    }
    for (int i = 1; i <= k; i++) {
      cur = 1LL * l[i - 1] * finv[i - 1] % MOD;
      cur = 1LL * cur * r[i + 1] % MOD * finv[k - i] % MOD;
      if ((k - i) % 2) cur = 1LL * cur * (MOD - 1) % MOD;
      ret = (ret + 1LL * cur * y[i] % MOD) % MOD;
    }
    return (ret % MOD + MOD) % MOD;
  }
} poly;
int y[N], n;
int query(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  int y;
  scanf("%d", &y);
  return y;
}
int main() {
  for (int i = 1; i <= 15; i++) {
    y[i] = query(i);
  }
  poly.init(15, y);
  int y = 0;
  for (int i = 0; i < MOD; i++) {
    y = poly.calc(i);
    if (!y) {
      printf("! %d\n", i);
      fflush(stdout);
      return 0;
    }
  }
  puts("! -1");
  fflush(stdout);
  return 0;
}
