import java.io.*;
import java.util.*;

public class TaskC {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());
        for (int i = 0; i < n - 1; i++) {
            br.readLine();
        }

        for (int i = n - 2; i >= 0; i--) {
            pw.println(i);
        }
        
        pw.close();
    }
}
