#include <bits/stdc++.h>
const int N = 25, Mod = 1e6 + 3;
const int n = 11;
int y[N], k, inv[Mod + 2];
int fm[] = {404910, 950915, 220896, 410947, 30845, 962989,
            30845,  410947, 220896, 950915, 404910};
inline int po(int x, int y) {
  int r = 1;
  while (y) {
    if (y & 1) r = 1ll * r * x % Mod;
    x = 1ll * x * x % Mod, y >>= 1;
  }
  return r;
}
int judge(int k) {
  int ans = 0, base = 1;
  for (int i = 1; i <= n; ++i)
    if (k != i) base = 1ll * base * (k - i) % Mod;
  if (1 <= k && k <= 11)
    return (1ll * base * fm[k - 1] % Mod * y[k] % Mod + Mod) % Mod;
  base = (base + Mod) % Mod;
  for (int i = 1; i <= n; ++i)
    ans = (ans + 1ll * base * inv[(k - i + Mod) % Mod] % Mod * fm[i - 1] % Mod *
                     y[i] % Mod) %
          Mod;
  return ans;
}
int main() {
  for (int i = 1; i <= n; ++i) {
    printf("? %d\n", i);
    fflush(stdout);
    scanf("%d", &y[i]);
  }
  inv[0] = inv[1] = 1;
  for (int i = 2; i < Mod; ++i)
    inv[i] = 1ll * (Mod - Mod / i) * inv[Mod % i] % Mod;
  for (int k = 0; k < Mod; ++k)
    if (!judge(k)) {
      printf("! %d\n", k);
      fflush(stdout);
      return 0;
    }
  printf("! -1\n");
  fflush(stdout);
}
