#include using namespace std; signed main(){ int N, K; cin >> N >> K; cout << ( N - 1 ) % ( K + 1 ) << endl; int rpy; while( cin >> rpy and rpy < N ){ cout << rpy + ( N - rpy - 1 + K + 1 ) % ( K + 1 ) << endl; } return 0; }