import sys n , k = map(int,sys.stdin.readline().split()) li = list(range(1,n+1)) answer = [] pop = 0 for i in range(1 ,n+1): pop = (pop + k-1) % len(li) answer.append(li.pop( pop )) print("<" + ", ".join(map(str,answer))+ ">" )