#include <bits/stdc++.h>
using namespace std;
const long long M = 1e6 + 3;
long long n = 11;
long long pow(long long t, long long st) {
  if (st == 1) {
    return t;
  }
  long long r = pow(t, st / 2);
  if (st % 2 == 0) {
    return (r * r) % M;
  }
  return ((r * r) % M * t) % M;
}
long long obr(long long t) { return pow(t, M - 2); }
void solve(vector<vector<long long>>& matr, vector<long long>& ans) {
  for (long long i = 0; i < n; ++i) {
    long long nonzero = i;
    for (long long j = i + 1; j < n; ++j) {
      if (matr[j][i]) {
        nonzero = j;
      }
    }
    swap(matr[nonzero], matr[i]);
    long long x = obr(matr[i][i]);
    for (long long j = 0; j < n + 1; ++j) {
      matr[i][j] = (matr[i][j] * x) % M;
    }
    for (long long j = 0; j < n; ++j) {
      if (j != i) {
        for (long long k = n; k > -1; --k) {
          matr[j][k] = (M + (matr[j][k] - matr[j][i] * matr[i][k]) % M) % M;
        }
      }
    }
  }
  for (long long j = 0; j < n; ++j) {
    ans[j] = matr[j][n];
  }
}
long long ask(long long a) {
  long long answ;
  cout << "? " << a << endl;
  cin >> answ;
  return answ;
}
long long P(int x, vector<long long> ans) {
  long long sum = ans[0];
  for (int i = 1; i < n; ++i) {
    sum += pow(x, i) * ans[i];
    sum = sum % M;
  }
  return sum;
}
int main() {
  vector<vector<long long>> matr(n, vector<long long>(n + 1));
  vector<long long> ans(n);
  for (long long i = 0; i < n; ++i) {
    matr[i][n] = ask(i);
  }
  for (long long i = 0; i < n; ++i) {
    matr[i][0] = 1;
    for (long long j = 1; j < n; ++j) {
      matr[i][j] = (matr[i][j - 1] * i) % M;
    }
  }
  solve(matr, ans);
  for (int i = 0; i < M; ++i) {
    if (!P(i, ans)) {
      cout << "! " << i;
      return 0;
    }
  }
  cout << "! " << -1;
}
