#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC optimize ("-O3", "Ofast", "unroll-loops")

#define whole(O) O.begin (), O.end ()

#define tS(O) (int) O.size ()

#define sqr(O) (O) * (O)
#define pw(O) (1LL << O)

using namespace std;

const long long Mod = 1e9 + 7;
const int MaXn = 5 * 1e5 + 1;

using namespace __gnu_pbds;

template <typename O>
using Ordered_Set = tree <O, null_type, less <O>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937_64 rnd (chrono :: system_clock :: now ().time_since_epoch ().count ());

int main () {

    ios_base :: sync_with_stdio (0);
    cin.tie (0); cout.tie (0);

    int n;
    cin >> n;

    n--;

    int k = -1;
    while (n--) {

        int a, b;
        cin >> a >> b;

        k = k + 1;
        cout << k << "\n";
    }

    return 0;
}
