#include <bits/stdc++.h>
using namespace std;
long long mod = (1e6) + 3;
long long power(long long t, long long x) {
  t = t % mod;
  long long r = 1;
  while (x != 0) {
    if (x & 1) r = (r * t) % mod;
    x >>= 1;
    t = (t * t) % mod;
  }
  return r;
}
int main() {
  int i, j, k;
  long long a[11][12], l, m, n;
  for (i = 0; i < 11; i++) {
    a[i][0] = 1;
    for (j = 1; j < 11; j++) a[i][j] = (a[i][j - 1] * i) % mod;
  }
  for (i = 0; i < 11; i++) {
    cout << "? " << i << endl;
    cin >> a[i][11];
  }
  for (i = 0; i < 11; i++) {
    for (j = i; j < 11; j++)
      if (a[j][i] != 0) break;
    if (i != j) swap(a[i], a[j]);
    m = power(a[i][i], mod - 2);
    for (j = 0; j < 11; j++) {
      if (i != j) {
        l = (a[j][i] * m) % mod;
        for (k = i; k < 12; k++)
          a[j][k] = (a[j][k] + mod - ((l * a[i][k]) % mod)) % mod;
      }
    }
  }
  long long b[11];
  for (i = 0; i < 11; i++) b[i] = (a[i][11] * power(a[i][i], mod - 2)) % mod;
  for (l = 0; l < mod; l++) {
    m = 0;
    n = 1;
    for (i = 0; i < 11; i++) {
      m = (m + b[i] * n) % mod;
      n = (n * l) % mod;
    }
    if (m == 0) {
      cout << "! " << l << endl;
      return 0;
    }
  }
  cout << "! -1" << endl;
  return 0;
}
