N, K = map(int, input().split()) arr = [i for i in range(1, N+1)] i = 0 ans = [] while len(arr) != 0: i = (i + K-1)%len(arr) ans.append(str(arr.pop(i))) print("<", ', '.join(ans), ">", sep='')