#include <bits/stdc++.h>
using namespace std;
int query(int x) {
  cout << "? " << x << endl;
  int ans;
  cin >> ans;
  return ans;
}
int answer(int x) {
  cout << "! " << x << endl;
  exit(0);
}
const int K = 10, M = 1e6 + 3;
int y[K + 1];
long long power(long long a, long long n) {
  if (n == 0) return 1;
  long long ans = power(a, n / 2);
  ans = (ans * ans) % M;
  if (n % 2) ans = (ans * a) % M;
  return ans;
}
long long invdenom[K + 1];
long long calc(int x) {
  long long ans = 0;
  for (int i = 0; i <= K; i++) {
    long long num = 1, denom = 1;
    for (int j = 0; j <= K; j++)
      if (j != i) {
        num = (num * (x - j)) % M;
        denom = (denom * (i - j)) % M;
        if (num < 0) num += M;
        if (denom < 0) denom += M;
      }
    if (invdenom[i] == -1) invdenom[i] = power(denom, M - 2);
    long long frac = (num * invdenom[i]) % M;
    ans = (ans + frac * y[i]) % M;
  }
  return ans;
}
int main() {
  memset(invdenom, -1, sizeof invdenom);
  for (int i = 0; i <= K; i++) {
    y[i] = query(i);
    if (y[i] == 0) answer(i);
  }
  for (int i = 0; i < M; i++) {
    if (calc(i) == 0) answer(i);
  }
  answer(-1);
}
