#include <bits/stdc++.h>
using namespace std;
long long x[12], inv[12], l[13], r[13], sum;
long long po(long long b, int p) {
  long long re = 1;
  while (p) {
    if (p & 1) re = re * b % 1000003;
    b = b * b % 1000003;
    p >>= 1;
  }
  return re;
}
int main() {
  for (int i = 0; i < 12; i++) {
    printf("? %d\n", i);
    fflush(stdout);
    scanf("%lld", x + i);
  }
  for (int i = 0; i < 12; i++) {
    inv[i] = 1;
    for (int j = 0; j < 12; j++)
      if (i != j)
        inv[i] =
            inv[i] * po((i - j + 1000003) % 1000003, 1000003 - 2) % 1000003;
  }
  l[0] = r[12] = 1;
  for (int i = 0; i < 1000003; i++) {
    for (int j = 0; j < 12; j++) l[j + 1] = l[j] * (i + 1000003 - j) % 1000003;
    for (int j = 11; j >= 0; j--) r[j] = r[j + 1] * (i + 1000003 - j) % 1000003;
    sum = 0;
    for (int j = 0; j < 12; j++)
      sum =
          (sum + l[j] * r[j + 1] % 1000003 * inv[j] % 1000003 * x[j]) % 1000003;
    if (sum == 0) {
      printf("! %d\n", i);
      fflush(stdout);
      return 0;
    }
  }
  puts("! -1");
}
