#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct Lagrange_Interpolation {
  long long dimension;
  vector<pair<T, T>> XY;
  vector<T> coefficient, function;
  Lagrange_Interpolation() {}
  Lagrange_Interpolation(vector<pair<T, T>>& xy) { initialization(xy); }
  ~Lagrange_Interpolation() {}
  T interpolation(T x) {
    T res = 0;
    for (int i = 0; i <= dimension; i++) {
      T temp = 1;
      for (int j = 0; j <= dimension; j++) {
        if (i == j) continue;
        temp *= (x - XY[j].first + ((int)1e6 + 3)) % ((int)1e6 + 3);
        temp %= ((int)1e6 + 3);
      }
      res += temp * XY[i].second % ((int)1e6 + 3) * coefficient[i] %
             ((int)1e6 + 3);
      res %= ((int)1e6 + 3);
    }
    return (res % ((int)1e6 + 3) + ((int)1e6 + 3)) % ((int)1e6 + 3);
  }
  void exgcd(long long a, long long b, long long& x, long long& y) {
    if (b == 0) {
      x = 1;
      y = 0;
      return;
    }
    exgcd(b, a % b, y, x);
    y -= a / b * x;
  }
  void initialization(vector<pair<T, T>>& xy) {
    dimension = xy.size() - 1;
    XY = xy;
    coefficient.resize(dimension + 1);
    function.resize(dimension + 1);
    for (int i = 0; i <= dimension; i++) {
      T temp = 1;
      for (int j = 0; j <= dimension; j++) {
        if (i == j) continue;
        temp *= (xy[i].first - xy[j].first + ((int)1e6 + 3)) % ((int)1e6 + 3);
        temp %= ((int)1e6 + 3);
      }
      long long x, y;
      exgcd(temp, ((int)1e6 + 3), x, y);
      coefficient[i] = x;
    }
  }
  void find_coefficient() {
    vector<vector<T>> table(dimension + 1, vector<T>(dimension + 2, 0));
    table[0][0] = 1;
    T sum = 0, sum2 = 0;
    for (int k = 0; k <= dimension; k++) {
      for (int i = 0; i < dimension; i++) {
        sum = sum2 = 0;
        for (int j = i, l = (i > k ? i + 1 : i); l <= dimension; l++) {
          if (l == k) continue;
          sum = (table[i][j] + sum) % ((int)1e6 + 3);
          table[i + 1][j + 1] =
              sum * (((int)1e6 + 3) - XY[l].first) % ((int)1e6 + 3);
          sum2 = (table[i + 1][j + 1] + sum2) % ((int)1e6 + 3);
          j++;
        }
        function[dimension - i - 1] = (sum2 * coefficient[k] % ((int)1e6 + 3) *
                                           XY[k].second % ((int)1e6 + 3) +
                                       function[dimension - i - 1]) %
                                      ((int)1e6 + 3);
      }
      function[dimension] =
          (coefficient[k] % ((int)1e6 + 3) * XY[k].second % ((int)1e6 + 3) +
           function[dimension]) %
          ((int)1e6 + 3);
    }
    for (int k = 0; k < dimension; k++) {
      function[k] = (function[k] + ((int)1e6 + 3)) % ((int)1e6 + 3);
    }
  }
  T substitution(T x) {
    T res = 0, d = 1;
    for (int i = 0; i <= dimension; i++, d *= x, d %= ((int)1e6 + 3)) {
      res = (res + function[i] * d) % ((int)1e6 + 3);
    }
    return (res % ((int)1e6 + 3) + ((int)1e6 + 3)) % ((int)1e6 + 3);
  }
};
int main() {
  Lagrange_Interpolation<long long> li;
  vector<pair<long long, long long>> test;
  for (long long i = 0, num; i <= 10; i++) {
    cout << "? " << i << endl;
    cout.flush();
    cin >> num;
    if (num == 0) {
      cout << "! " << i << endl;
      cout.flush();
      return 0;
    } else
      test.push_back(make_pair(i, num));
  }
  li.initialization(test);
  li.find_coefficient();
  for (int i = 0; i < ((int)1e6 + 3); i++) {
    if (li.substitution(i) == 0) {
      cout << "! " << i << endl;
      cout.flush();
      return 0;
    }
  }
  cout << "! " << -1 << endl;
  cout.flush();
  return 0;
}
