#include <bits/stdc++.h>
using namespace std;
long long powMod(long long a, long long p, long long m) {
  if (p == 1) {
    return a % m;
  }
  if (p == 0) {
    return 1;
  }
  long long temp = powMod(a, p / 2, m);
  if (p % 2 == 1) {
    return (a * temp % m) * temp % m;
  }
  return temp * temp % m;
}
int main() {
  ios_base::sync_with_stdio(0);
  const long long mod = 1000003;
  long long q[12];
  for (long long i = 0; i < 11; i++) {
    cout << "? " << i << endl;
    cout.flush();
    cin >> q[i];
    if (q[i] == -1) {
      return 0;
    }
    if (q[i] == 0) {
      cout << "! " << i;
      cout.flush();
      return 0;
    }
  }
  long long term[12];
  for (int i = 0; i < 11; i++) {
    long long reversed = 1;
    for (int j = 0; j < 11; j++) {
      if (i != j) {
        reversed *= ((i - j) + mod);
        reversed %= mod;
      }
    }
    reversed = powMod(reversed, mod - 2, mod);
    reversed *= q[i];
    reversed %= mod;
    term[i] = reversed;
  }
  for (long long i = 11; i < mod; i++) {
    long long res = 0;
    for (int j = 0; j < 11; j++) {
      long long nextTerm = 1;
      for (int k = 0; k < 11; k++) {
        if (k != j) {
          nextTerm *= i - k;
          nextTerm %= mod;
        }
      }
      nextTerm *= term[j];
      res += nextTerm;
      res %= mod;
    }
    if (res == 0) {
      cout << "! " << i;
      cout.flush();
      return 0;
    }
  }
  cout << "! " << -1;
  cout.flush();
  return 0;
}
