#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 15, OO = 1e6 + 3;
int n, q, t1, t2;
int inv[N], y[15], de[15];
long long MOD(long long a, long long b) {
  a %= b;
  if (a < 0) a += b;
  return a;
}
void rangeInv(long long m) {
  inv[1] = 1;
  for (long long i = 2; i < m; ++i) inv[i] = (m - (m / i) * inv[m % i] % m) % m;
}
int f(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  scanf("%d", &x);
  return x;
}
int F(int x) {
  int ret = 0;
  for (int i = 0; i < 11; ++i) {
    int l = 1;
    for (int j = 0; j < 11; ++j) {
      if (j == i) continue;
      l = MOD(1ll * l * (x - j), OO);
    }
    int li = de[i];
    l = (1ll * li * l) % OO;
    ret += (1ll * l * y[i]) % OO;
    if (ret >= OO) ret -= OO;
  }
  return ret;
}
int main() {
  rangeInv(OO);
  for (int i = 0; i < 11; ++i) {
    y[i] = f(i);
    de[i] = 1;
    for (int j = 0; j < 11; ++j) {
      if (j == i) continue;
      de[i] = MOD(de[i] * (i - j), OO);
    }
    de[i] = inv[de[i]];
  }
  for (int i = 0; i <= OO; ++i) {
    if (F(i) == 0) {
      printf("! %d\n", i);
      fflush(stdout);
      return 0;
    }
  }
  printf("! -1\n");
  fflush(stdout);
}
