#include <bits/stdc++.h>
using namespace std;
const int mod = 1e6 + 3;
long long x[20], y[20], l[20][20], a[20];
long long inv[mod];
int main() {
  inv[1] = 1;
  for (int i = 2; i < mod; i++) inv[i] = mod - mod / i * inv[mod % i] % mod;
  for (int i = 0; i <= 10; i++) {
    x[i] = i;
    printf("? %lld\n", x[i]);
    fflush(stdout);
    scanf("%lld", &y[i]);
  }
  for (int i = 0; i <= 10; i++) {
    l[i][10] = y[i];
    for (int j = 0; j <= 10; j++)
      if (i != j) l[i][10] = (l[i][10] * inv[(x[i] - x[j] + mod) % mod]) % mod;
    for (int j = 0; j <= 10; j++) {
      if (i == j) continue;
      for (int k = 1; k <= 10; k++)
        l[i][k - 1] = (l[i][k - 1] + l[i][k] * (mod - x[j])) % mod;
    }
  }
  for (int i = 0; i <= 10; i++)
    for (int j = 0; j <= 10; j++) a[j] = (a[j] + l[i][j]) % mod;
  for (int i = 0; i < mod; i++) {
    long long s = 0;
    for (int j = 10; j >= 0; j--) s = (s * i + a[j]) % mod;
    if (s == 0) {
      printf("! %d\n", i);
      return 0;
    }
  }
  printf("! -1\n");
}
