import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int n = kb.nextInt();
int k = kb.nextInt();
Queue<Integer> queue = new LinkedList<>();
for(int i=1; i<=n; i++) {
queue.add(i);
}
sb.append("<");
while(queue.size()>1) {
for (int i = 0; i < k - 1; i++) {
queue.add(queue.remove());
}
sb.append(queue.remove()).append(", ");
}
sb.append(queue.remove()).append(">");
System.out.println(sb.toString());
}
}