#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <set>
#include <cstdio>
#include <cmath>
#define rep(i,l,n) for(lint i=l;i<n;i++)
#define rer(i,l,n) for(lint i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vli;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int n;
	cin>>n;
	vi d(n);
	int f,l,sf,sl;
	rep(i,0,n*(n-1)/2){
		cin>>f>>l>>sf>>sl;
		f--;
		l--;
		if(sf<sl){
			d[l]+=3;
		}else if(sf>sl){
			d[f]+=3;
		}else{
			d[l]++;
			d[f]++;
		}
	}
	vi e=d;
	sort(all(e));
	rep(i,0,n){
		int res=upper_bound(all(e),d[i])-e.begin();
		o(n+1-res);
	}
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N;
    cin >> N;
    vector<P>ab(N);
    vector<P>cd(N);
    for(int i = 0; i < N; i++) {
        int a,b;
        cin >> a >> b;
        ab[i].first = a;
        ab[i].second = b;
    }
    for(int i = 0; i < N; i++) {
        int c,d;
        cin >> c >> d;
        cd[i].first = c;
        cd[i].second = d;
    }
    vector<bool>ok(N,false);
    sort(ab.begin(),ab.end());
    reverse(ab.begin(),ab.end());
    int ans = 0;
    for(int i = 0; i < N; i++) {
        int X = INF;
        int Y = INF;
        for(int j = 0; j < N; j++) {
            if(ab[i].first < cd[j].first && ab[i].second < cd[j].second) {
                if((!ok[j]) && X > cd[j].second) {
                    X = cd[j].second;
                    Y = j;
                }
                
            }
        }
        if(Y != INF) {
            ok[Y] = true;
        }
    }
    for(int i = 0; i < N; i++) {
        if(ok[i]) {
            ans++;
        }
    }
    cout << ans << endl;
}
