#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
const int N = 1e5;
int a[N];
int b[N];
int main()
{
int n; cin >> n;
int len =0 ;
for(int i=1;i<=n;i++)
{
cin >> a[i];
b[++len] = a[i];
}
sort(b+1,b+1+len);
len = unique(b+1,b+1+len) - b -1;
for(int i=1;i<=n;i++)
a[i] = lower_bound(b+1,b+1+len,a[i]) - b;
for(int i=1;i<=n;i++)
cout <<a[i];
return 0;
}