''' 백준 1158 - 블로그 답 (rotate사용 안함) '''
from collections import deque
result = []
n, k = map(int, input().split())
deq = deque([i+1 for i in range(n)])
while deq:
for i in range(k-1):
deq.append(deq.popleft()) # k번째 전까지 rotate시킴
result.append(deq.popleft())
print("<", end="")
for i in result[:len(result)-1]:
print(i, end = ", ")
print(result[-1], end="")
print(">")
''' 백준 1158 - 블로그 답 참고 (rotate() 사용) '''
''' 계속 틀렸다는데 왜 틀린지 모르겠음 !! '''
from collections import deque
result = []
n, k = map(int, input().split())
deq = deque([i+1 for i in range(n)])
while deq:
deq.rotate(-2)
result.append(deq.popleft())
print("<", end="")
for i in result[:len(result)-1]:
print(i, end = ", ")
print(result[-1], end="")
print(">")
''' 이후 2달 후에 내 힘으로 품 '''
''' 얘도 틀렸다는데 왜틀렸지? ''' ''' => 틀렸던 이유 찾았다!!!!'''
from collections import deque
result = []
i, j = map(int,input().split())
deq = deque([x+1 for x in range(i)])
while deq:
deq.rotate(-j+1) # 여기서 K값에 따라 로테이션 돌아야 하는데 "-2"로 고정시켜서 틀렸었음
result.append(deq.popleft())
print("<" + str(result)[1:-1] + ">")