import java.util.*;
public class Main {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        for(int i = 1 ; i < n ; i++){
            int a = s.nextInt();
            int b = s.nextInt();
            System.out.println(n-i-1);
        }
        //System.out.println("Hello World!");
    }
}