a = list(map(int, input().split()))
b=[]
for i in range(1,a[0]+1):
b.append(i)
c=[]
while len(b) != 0:
d=[]
if len(b) < a[1]:
front = a[1] % len(b) -1
else:
front = a[1]-1
c.append(b[front])
b.pop(front)
for i in range(len(b)):
d.append(b[(front + i) % len(b)])
b = d
result = ", ".join(map(str,c))
print("<" +result +">")
YSA9IGxpc3QobWFwKGludCwgaW5wdXQoKS5zcGxpdCgpKSkKCmI9W10KZm9yIGkgaW4gcmFuZ2UoMSxhWzBdKzEpOgogICAgYi5hcHBlbmQoaSkKICAgIApjPVtdCndoaWxlIGxlbihiKSAhPSAwOgogICAgZD1bXQogICAgaWYgbGVuKGIpIDwgYVsxXToKICAgICAgICBmcm9udCA9IGFbMV0gJSBsZW4oYikgLTEKICAgIGVsc2U6CiAgICAgICAgZnJvbnQgPSBhWzFdLTEgIAogICAgYy5hcHBlbmQoYltmcm9udF0pCiAgICBiLnBvcChmcm9udCkKICAgIGZvciBpIGluIHJhbmdlKGxlbihiKSk6CiAgICAgICAgZC5hcHBlbmQoYlsoZnJvbnQgKyBpKSAlIGxlbihiKV0pCiAgICBiID0gZAogICAgICAgICAgIAoKcmVzdWx0ID0gIiwgIi5qb2luKG1hcChzdHIsYykpCnByaW50KCI8IiArcmVzdWx0ICsiPiIp