#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); long long N,K; cin >> N >> K; K--; if(K == 0){cout << N << endl; return 0;} const int n = 100003; vector To(n); for(int i=1; i next(n); for(int i=0; i>= 1,swap(To,next); } cout << pos << endl; }