#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
typedef
tree<
pair<int,int>,
null_type,
less<pair<int,int>>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
int sz=0;
cin>>n;
vector<int> ans(n,0);
ordered_set t;
int x,y;
for(int i=0;i<n;i++)
{
cin>>x>>y;
ans[t.order_of_key({x,++sz})]++;
t.insert({x,sz});
}
for(int i=0;i<n;i++)
cout<<ans[i]<<'\n';
}
I2luY2x1ZGUgPGV4dC9wYl9kcy9hc3NvY19jb250YWluZXIuaHBwPgojaW5jbHVkZSA8ZXh0L3BiX2RzL3RyZWVfcG9saWN5LmhwcD4KI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2UgX19nbnVfcGJkczsKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnR5cGVkZWYKdHJlZTwKICBwYWlyPGludCxpbnQ+LAogIG51bGxfdHlwZSwKICBsZXNzPHBhaXI8aW50LGludD4+LAogIHJiX3RyZWVfdGFnLAogIHRyZWVfb3JkZXJfc3RhdGlzdGljc19ub2RlX3VwZGF0ZT4Kb3JkZXJlZF9zZXQ7CgptYWluKCkKIHsKICAgIGlvczo6c3luY193aXRoX3N0ZGlvKDApOwogICAgY2luLnRpZSgwKTsKICAgIGludCBuOwogICAgaW50IHN6PTA7CiAgICBjaW4+Pm47CiAgICB2ZWN0b3I8aW50PiBhbnMobiwwKTsKCiAgICBvcmRlcmVkX3NldCB0OwogICAgaW50IHgseTsKICAgIGZvcihpbnQgaT0wO2k8bjtpKyspCiAgICB7CiAgICAgICAgY2luPj54Pj55OwogICAgICAgIGFuc1t0Lm9yZGVyX29mX2tleSh7eCwrK3N6fSldKys7CiAgICAgICAgdC5pbnNlcnQoe3gsc3p9KTsKICAgIH0KCiAgICBmb3IoaW50IGk9MDtpPG47aSsrKQogICAgICAgIGNvdXQ8PGFuc1tpXTw8J1xuJzsKfQ==