#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k;
queue<int> q;
cin >> n >> k;
for(int i=1;i<=n;i++) {
q.push(i);
}
cout << '<';
while(!q.empty()) {
for(int i=1;i<k;i++) {
if(k!=1) {
int bak = q.front();
q.pop();
q.push(bak);
}
}
if(q.size()!=1) {
cout << q.front() << ", ";
}
else {
cout << q.front() << '>';
}
q.pop();
}
}
for문 증가식에 k++ 썼다가 계속 시간 초과 나와서 당황했다. 근무 뛰고 오니 정신이 오락가락한다,,