#include <bits/stdc++.h>
using namespace std;
long long mat[11][11];
long long ans[11];
long long us(long long a, long long b) {
  long long aaa = 1;
  while (b) {
    if (b & 1) {
      aaa *= a;
      aaa %= 1000003;
    }
    b >>= 1;
    a *= a;
    a %= 1000003;
  }
  return aaa;
}
long long inv(long long a) { return us(a, 1000003 - 2); }
void ayar(long long& a) { a = ((a % 1000003) + 1000003) % 1000003; }
void pm() {
  for (int i = 0; i < 11; i++) {
    for (int j = 0; j < 11; j++) {
      cout << mat[i][j] << " ";
    }
    cout << ans[i] << endl;
  }
  cout << endl;
}
int main() {
  for (int i = 0; i < 11; i++) {
    cout << "? " << i << endl;
    cout.flush();
    cin >> ans[i];
  }
  for (long long i = 0; i < 11; i++) {
    for (long long j = 0; j < 11; j++) {
      if (i == 0 && j == 0)
        mat[i][j] = 1;
      else
        mat[i][j] = us(i, j);
    }
  }
  for (long long j = 0; j < 11 - 1; j++) {
    for (long long i = j + 1; i < 11; i++) {
      if (mat[i][j] == 0) continue;
      long long fact = mat[i][j] * inv(mat[j][j]);
      ayar(fact);
      for (int k = 0; k < 11; k++) {
        mat[j][k] *= fact;
        ayar(mat[j][k]);
      }
      ans[j] *= fact;
      ayar(ans[j]);
      for (int k = 0; k < 11; k++) {
        mat[i][k] -= mat[j][k];
        ayar(mat[i][k]);
      }
      ans[i] -= ans[j];
      ayar(ans[i]);
    }
  }
  for (int i = 11 - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      long long fact = mat[j][i] * inv(mat[i][i]);
      if (mat[j][i] == 0) continue;
      ayar(fact);
      for (int k = 0; k < 11; k++) {
        mat[i][k] *= fact;
        ayar(mat[i][k]);
      }
      ans[i] *= fact;
      ayar(ans[i]);
      for (int k = 0; k < 11; k++) {
        mat[j][k] -= mat[i][k];
        ayar(mat[j][k]);
      }
      ans[j] -= ans[i];
      ayar(ans[j]);
    }
    long long fact = inv(mat[i][i]);
    for (int k = 0; k < 11; k++) {
      mat[i][k] *= fact;
      ayar(mat[i][k]);
    }
    ans[i] *= fact;
    ayar(ans[i]);
  }
  for (long long x = 0; x < 1000003; x++) {
    long long a = 0;
    for (int i = 0; i < 11; i++) {
      a += ans[i] * us(x, i);
      ayar(a);
    }
    if (a == 0) {
      cout << "! " << x << endl;
      exit(0);
    }
  }
  cout << "! " << -1 << endl;
}
