#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll mod = 1e6 + 3;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());
vector<ll> mul(11);
vector<ll> vec(11);
ll func(const ll x) {
  ll ret = 0;
  for (int i = 0; i < (int)(11); i++) {
    ll now = mul[i] * vec[i] % mod;
    for (int j = 0; j < (int)(11); j++) {
      if (i == j) continue;
      now *= (x + mod - j);
      now %= mod;
    }
    ret += now;
  }
  return ret % mod;
}
int extgcd(int a, int b, int& x, int& y) {
  int d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
int mod_inverse(int a, int m) {
  int x, y;
  extgcd(a, m, x, y);
  return (m + x % m) % m;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  for (int i = 0; i < (int)(11); i++) {
    cout << "? " << i << endl;
    int ret;
    cin >> ret;
    if (ret == 0) {
      cout << "! " << i << endl;
      return 0;
    }
    vec[i] = ret;
  }
  for (int i = 0; i < (int)(11); i++) {
    ll d = 1;
    for (int j = 0; j < (int)(11); j++) {
      if (i == j) continue;
      d *= (i + mod - j);
      d %= mod;
    }
    mul[i] = mod_inverse(d, mod);
  }
  for (int i = 0; i < (int)(mod); i++) {
    if (func(i) == 0) {
      cout << "! " << i << endl;
      return 0;
    }
  }
  cout << "! -1" << endl;
}
