#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int inv[20], x[N], y[N], o;
inline void que(const int x) {
  printf("? %d\n", x), fflush(stdout), scanf("%d", &o);
}
inline int ksm(register int x, register int L) {
  register int ans = 1;
  while (L)
    L& 1 ? ans = (0ll + ans) * x % 1000003 : 0, x = (0ll + x) * x % 1000003,
           L >>= 1;
  return ans;
}
inline void puo(const int x) { printf("! %d\n", x), fflush(stdout); }
int main() {
  register int i, j, ans, tot;
  for (i = 0; i <= 10; ++i) {
    x[i] = i, que(i), y[i] = o;
    if (!o) return puo(i), 0;
  }
  for (i = 0; i <= 10; ++i)
    for (j = 0, inv[i] = 1; j <= 10; ++j)
      if (i ^ j)
        inv[i] = (0ll + inv[i]) * ksm(x[i] - x[j], 1000003 - 2) % 1000003;
  for (register int X = 11; X < 1000003; ++X) {
    for (i = 0, tot = 0; i <= 10; ++i) {
      for (j = 0, ans = (0ll + y[i]) * inv[i] % 1000003; j <= 10; ++j)
        if (i ^ j) ans = (0ll + ans) * (X - x[j]) % 1000003;
      ans = (ans < 0 ? ans + 1000003 : ans), tot += ans,
      tot = (tot >= 1000003 ? tot - 1000003 : tot);
    }
    if (!tot) return puo(X), 0;
  }
  puo(-1);
  return 0;
}
