#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll A[16][16];
ll inv[1000006];
ll P = 1000003;
ll a[16];
void invtable(ll P) {
  inv[1] = 1;
  for (int i = 2; i < P; i++) {
    inv[i] = (P - (P / i)) * inv[P % i] % P;
  }
}
void Gauss() {
  for (int i = 0; i < 11; i++) {
    bool ok = 0;
    for (int j = i; j < 11; j++) {
      if (A[j][i]) {
        swap(A[j], A[i]);
        ok = 1;
        break;
      }
    }
    if (!ok) continue;
    ll fs = A[i][i];
    for (int j = i + 1; j < 11; j++) {
      ll r = A[j][i] * inv[fs] % P;
      for (int k = i; k <= 11; k++) {
        A[j][k] -= A[i][k] * r % P;
        A[j][k] = (A[j][k] + P) % P;
      }
    }
  }
}
int main() {
  invtable(1000003);
  for (int i = 0; i <= 10; i++) {
    int j = 1;
    for (int k = 0; k <= 10; k++) {
      A[i][k] = j;
      j = j * i % P;
    }
    cout << "? " << i << endl;
    cin >> A[i][11];
  }
  Gauss();
  for (int i = 10; i >= 0; i--) {
    a[i] = A[i][11];
    for (int j = i + 1; j <= 10; j++) {
      a[i] -= a[j] * A[i][j] % P;
      a[i] = (a[i] + P) % P;
    }
    a[i] = a[i] * inv[A[i][i]] % P;
  }
  for (int i = 0; i < P; i++) {
    ll res = 0;
    ll x = 1;
    for (int j = 0; j <= 10; j++) {
      res = (res + a[j] * x) % P;
      x = x * i % P;
    }
    if (res == 0) {
      cout << "! " << i << endl;
      return 0;
    }
  }
  cout << "! " << -1 << endl;
}
