#include <bits/stdc++.h>
using namespace std;
const int MD = 20;
const long long MOD = 1000003;
int main() {
  long long n;
  vector<long long> v(MD);
  vector<vector<long long> > a;
  for (int i = 0; i < MD; i++) {
    cout << "? " << i << endl << flush;
    cin >> v[i];
    if (v[i] == 0) {
      cout << "! " << i << endl;
      exit(0);
    }
  }
  a.push_back(v);
  vector<long long> empty;
  for (int i = 1; i < MD; i++) {
    a.push_back(empty);
    for (int j = 0; j + 1 < a[i - 1].size(); j++)
      a[i].push_back((a[i - 1][j + 1] - a[i - 1][j] + MOD) % MOD);
  }
  vector<long long> w;
  for (int i = 0; i < MD; i++) w.push_back(a[i][MD - i - 1]);
  for (int i = MD; i < MOD; i++) {
    for (int j = w.size() - 2; j >= 0; j--) w[j] = (w[j] + w[j + 1]) % MOD;
    if (w[0] == 0) {
      cout << "! " << i << endl;
      exit(0);
    }
  }
  cout << "! " << -1 << endl;
}
