#include <bits/stdc++.h>
using namespace std;
const int N = 11, MOD = 1e6 + 3;
int inv[MOD];
int f[N];
int c[N];
int query(int first) {
  cout << "? " << first << endl;
  cout.flush();
  int second;
  cin >> second;
  assert(second != -1);
  return second;
}
void answer(int first) {
  cout << "! " << first << endl;
  cout.flush();
  exit(EXIT_SUCCESS);
}
int mul(int a, int b) { return (a * 1LL * b) % MOD; }
int func(int first) {
  if (first < N) return f[first];
  int prod = 1;
  for (int i = 0; i < N; i++) {
    prod = mul(prod, first - i);
  }
  int ret = 0;
  for (int i = 0; i < N; i++) {
    ret = (ret + mul(c[i], mul(prod, inv[first - i]))) % MOD;
  }
  return ret;
}
int main() {
  for (int i = 0; i < N; i++) f[i] = query(i);
  inv[1] = 1;
  for (int i = 2; i < MOD; i++) {
    inv[i] = mul(MOD - MOD / i, inv[MOD % i]);
  }
  for (int i = 0; i < N; i++) {
    c[i] = 1;
    for (int j = 0; j < N; j++)
      if (j != i) {
        c[i] = mul(c[i], inv[abs(i - j)]);
        if (i < j) c[i] = MOD - c[i];
      }
    c[i] = mul(c[i], f[i]);
  }
  for (int i = 0; i < MOD; i++)
    if (func(i) == 0) answer(i);
  answer(-1);
  return 0;
}
