#include #include #include #include using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, k, a = 0; cin >> n >> k; int b = (n - 1) % (k + 1); cout << b << endl; cout.flush(); while(cin >> a , a < n) { int s = (a - b) / (k + 1); int d = a - (b + (k + 1) * s); cout << a + k + 1 - d << endl; cout.flush(); } }