
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] input = sc.nextLine().split(" ");
int N = Integer.parseInt(input[0]);
int K = Integer.parseInt(input[1]);
sc.close();
ArrayList<Integer> people = new ArrayList<Integer>();
for (int i = 1; i <= N; i++) {
people.add(i);
}
int idx = 0;
System.out.print("<");
while (people.size() > 1) {
idx = (idx + K - 1) % people.size();
System.out.print(people.remove(idx) + ", ");
}
System.out.print(people.get(0));
System.out.println(">");
}
}