#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e6 + 3;
long long fastexp(long long a, long long b, long long n) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % n;
    a = a * a % n;
    b >>= 1;
  }
  return res;
}
int main() {
  vector<long long> p(11), re(mod);
  for (long long i = 1; i < mod; i++) {
    re[i] = fastexp(i, mod - 2, mod);
  }
  for (int i = 0; i < 11; i++) {
    cout << "? " << i << endl;
    cin >> p[i];
    if (p[i] == -1) {
      return 0;
    }
    if (p[i] == 0) {
      cout << "! " << i << endl;
      return 0;
    }
  }
  for (int i = 0; i < 11; i++) {
    for (int j = 0; j < 11; j++) {
      if (j == i) continue;
      p[i] = p[i] * re[(i - j + mod) % mod] % mod;
    }
  }
  for (int x = 11; x < mod; x++) {
    long long val = 0;
    for (int i = 0; i < 11; i++) {
      val += p[i] * re[x - i];
    }
    if (val % mod == 0) {
      cout << "! " << x << endl;
      return 0;
    }
  }
  cout << "! -1" << endl;
  return 0;
}
