#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

typedef pair<int, int> pii;
int main(){
    int n;
    while(cin >> n && n){
        vector<pii> v(n);
        rep(i,n) v[i].second = i;
        int game = n * (n-1) / 2;

        rep(i,game){
            int a,b,c,d;
            cin >> a >> b >> c >> d;
            if(c>d) v[a-1].first += 3;
            else if(c < d) v[b-1].first += 3;
            else v[a-1].first++, v[b-1].first++;
        }

        sort(v.rbegin(), v.rend());
        int score = -1;
        int rank = 1;
        rep(i,n){
            if (v[i].first == score) v[i].first = rank;
            else {
                score=v[i].first;
                v[i].first=i+1;
                rank=i+1;
            }
        }
        sort(v.begin(), v.end(), [](pii l,pii r){
                return l.second < r.second;
            });
        rep(i,n)cout<<v[i].first<<endl;
    }
}
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever for (;;)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int n) { return n & 1; }
constexpr bool even(const int n) { return ~n & 1; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> std::istream &operator>>(std::istream &is, std::pair<A, B> &p) { is >> p.first; is >> p.second; return is; }
using namespace std;
// clang-format on

main {
  int n;
  cin >> n;
  vi v(n);
  rep(i, n * (n - 1) / 2) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    --a, --b;
    if (c == d) {
      v[a]++;
      v[b]++;
      continue;
    }
    v[c > d ? a : b] += 3;
  }
  rep(i, n) {
    int r = 1;
    rep(j, n) r += v[i] < v[j];
    cout << r << endl;
  }
}