#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e6 + 3;
const int N = 3e5 + 5;
int n, m, k, x;
int p[12];
int query(int x) {
  printf("? %d\n", x);
  fflush(stdout);
  int val;
  scanf("%d", &val);
  return val;
}
void write(int x) {
  printf("! %d\n", x);
  fflush(stdout);
}
int ksm(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = (1ll * res * x) % mod;
    y >>= 1;
    x = (1ll * x * x) % mod;
  }
  return res;
}
int main() {
  for (int i = 0; i <= 10; i++) {
    p[i] = query(i);
    if (p[i] == 0) return write(i), 0;
  }
  for (int i = 0; i <= 10; i++) {
    int v = 1;
    for (int j = 0; j <= 10; j++) {
      if (j == i) continue;
      v = ((i - j + mod) % mod * 1ll * v) % mod;
    }
    p[i] = (p[i] * 1ll * ksm(v, mod - 2)) % mod;
  }
  for (int i = 11; i <= mod - 1; i++) {
    int v = 0;
    for (int j = 0; j <= 10; j++) {
      int val = 1;
      for (int k = 0; k <= 10; k++) {
        if (j == k) continue;
        val = ((i - k + mod) % mod * 1ll * val) % mod;
      }
      val = (val * 1ll * p[j]) % mod;
      v = (val + v) % mod;
    }
    if (!v) return write(i), 0;
  }
  write(-1);
  return 0;
}
