#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define _fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
    _fastio;
    ll n;
    cin >> n;
    ll a[n], b[n];
    map<ll,pair<ll,ll>> occ; // first attribute the occ + second the counter
    for(int i=0;i<n;i++) {
        cin >> a[i];
        b[i] = a[i];
        occ[a[i]].first++;
        occ[a[i]].second = 0;
    }
    for(int i=0;i<n;i++){
        if(occ[b[i]].second != 0) {
            ll temp = b[i] + occ[b[i]].second;
            occ[b[i]].second++;
            temp += occ[temp].second;
            occ[temp].first++;
            occ[temp].second++;
            b[i] = temp;
        }
        else {
            occ[b[i]].first--;
            occ[b[i]].second++;
        }
        cout << b[i] << " ";
    }
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define _fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
    _fastio;
    ll n;
    cin >> n;
    ll a[n], b[n];
    map<ll,ll> occ; // first attribute the occ + second the counter
    for(int i=0;i<n;i++) {
        cin >> a[i];
        b[i] = a[i];
        occ[a[i]]++;
    }
    for(int i=0;i<n;i++){
        if(occ[b[i]] > 1){
            occ[b[i]]--;
            ll temp = b[i];
            while(occ[temp]) temp++;
            b[i] = temp;
            occ[b[i]]++;
        }
        cout << b[i] << " ";
    }
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define _fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
    _fastio;
    ll n;
    cin >> n;
    ll a[n], b[n];
    map<ll, ll> occ; // first attribute the occ + second the counter
    for(int i=0;i<n;i++) {
        cin >> a[i];
        b[i] = a[i];
        occ[a[i]]++;
    }
    for(int i=0;i<n;i++){
        if(occ[a[i]] > 1){
            b[i] += (occ[a[i]]) - 1;
            occ[a[i]]--;
        }
        cout << b[i] << " ";
    }
    cout << endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define _fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
    _fastio;
    ll n;
    cin >> n;
    ll a[n], b[n];
    map<ll,ll> occ; // first attribute the occ + second the counter
    for(int i=0;i<n;i++) {
        cin >> a[i];
        b[i] = a[i];
        occ[a[i]]++;
    }
    for(int i=0;i<n;i++){
        if(occ[b[i]] > 1){
            ll temp = b[i] + occ[b[i]] - 1;
            occ[b[i]]--;
            while(occ[temp]) temp++;
            b[i] = temp;
            occ[b[i]]++;
        }
        cout << b[i] << " ";
    }
    cout << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;

    vector<pair<int, int> > a(n, make_pair(0, 0));
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        a[i].first = b;
        a[i].second = i;
    }

    sort(a.begin(), a.end());
    int b = a[0].first;
    for(int i = 0; i < n; i++){
        if(b <= a[i].first)b = a[i].first + 1;
        else {
            a[i].first = b;
            b++;
        }
    }

    for(int i = 0; i < n; i++)swap(a[i].first, a[i].second);

    sort(a.begin(), a.end());

    for(int i = 0; i < n; i++)cout << a[i].second << ' ';

}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;

    vector<pair<int, int> > a(n, make_pair(0, 0));
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        a[i].first = b;
        a[i].second = i;
    }

    sort(a.begin(), a.end());

    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n && a[j].first == a[i].first; j++)a[j].first++;
    }

    for(int i = 0; i < n; i++)swap(a[i].first, a[i].second);

    sort(a.begin(), a.end());

    for(int i = 0; i < n; i++)cout << a[i].second << ' ';

}


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;

    vector<pair<int, int> > a(n, make_pair(0, 0));
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        a[i].first = b;
        a[i].second = i;
    }

    sort(a.begin(), a.end());

    for(int i = 0; i < n; i++){

        for(int j = i + 1; j < n && a[j].first == a[i].first; j++){
            a[j].first += j - i;
            //cout << a[i].first << ' ' << j << ' ' << i << endl;
        }

    }

    for(int i = 0; i < n; i++)swap(a[i].first, a[i].second);

    sort(a.begin(), a.end());

    for(int i = 0; i < n; i++)cout << a[i].second << ' ';

}


#include<bits/stdc++.h>
using namespace std;
#define asgnarr(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define fast ios_base::sync_with_stdio(false)
#define loop(a,b) for(int i=a;i<b;i++)
#define mem(a,x) memset(a,x,sizeof(a))
#define pii pair<int,int>
#define psi pair<string,int>
#define pss pair<string,string>
#define pll pair<long long,long long>
#define pls pair<long long,string>
#define pis pair<int,string>
#define pcc pair<char,char>
#define pb push_back
#define all(v) v.begin(),v.end()

typedef long long lli;
typedef long li;
typedef unsigned long long ulli;
typedef unsigned long int uli;
typedef unsigned int ui;
typedef long double ld;

inline int iseven(int x){return x&1?0:1;}

inline bool is_double(double x)
{
    double y=x-(int)x;
    return (y==x?true:false);
}

li bigmod(li b,li p,lli m)
{
    if(p==0)
        return 1;
    if(p%2==0)
    {
        return (li)pow(bigmod(b,p/2,m)%m,2)%m;
    }
    return (b%m*bigmod(b,p-1,m)%m)%m;
}

map<int,int>par;
map<int,bool>avail;

lli find_par(lli x)
{
    while(avail[par[x]]==true)
    {
        par[x]=find_par(par[x]);
    }
    return par[x];
}

int main()
{
    fast;
    lli n;
    cin>>n;
    lli a[n];
    map<lli,stack<lli>>pos;
    for(lli i=0;i<n;i++)
    {
        cin>>a[i];
        par[a[i]]=a[i];
        pos[a[i]].push(i);
    }
    sort(a,a+n,greater<lli>());
    for(int i=0;i<n;i++)
    {
        if(avail[a[i]]==false)
        {
            avail[a[i]]=true;
            par[a[i]]++;
        }
        else
        {
            lli x=find_par(a[i]);
            swap(a[i],x);
            lli y=pos[x].top();
            pos[x].pop();
            pos[a[i]].push(y);
            par[x]++;
        }
    }
    lli b[n];
    for(lli i=0;i<n;i++)
    {
        lli x=a[i];
        lli y=pos[x].top();
        b[y]=x;
        pos[x].pop();
    }
    for(lli i=0;i<n;i++)
        cout<<b[i]<<' ';
}


#include<bits/stdc++.h>
using namespace std;
#define asgnarr(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define fast ios_base::sync_with_stdio(false)
#define loop(a,b) for(int i=a;i<b;i++)
#define mem(a,x) memset(a,x,sizeof(a))
#define pii pair<int,int>
#define psi pair<string,int>
#define pss pair<string,string>
#define pll pair<long long,long long>
#define pls pair<long long,string>
#define pis pair<int,string>
#define pcc pair<char,char>
#define pb push_back
#define all(v) v.begin(),v.end()

typedef long long lli;
typedef long li;
typedef unsigned long long ulli;
typedef unsigned long int uli;
typedef unsigned int ui;
typedef long double ld;

inline int iseven(int x){return x&1?0:1;}

inline bool is_double(double x)
{
    double y=x-(int)x;
    return (y==x?true:false);
}

li bigmod(li b,li p,lli m)
{
    if(p==0)
        return 1;
    if(p%2==0)
    {
        return (li)pow(bigmod(b,p/2,m)%m,2)%m;
    }
    return (b%m*bigmod(b,p-1,m)%m)%m;
}

map<int,int>par;
map<int,bool>avail;

lli find_par(lli x)
{
    while(avail[par[x]]==true)
    {
        par[x]=find_par(par[x]);
    }
    return par[x];
}

int main()
{
    lli n;
    scanf("%lld",&n);
    lli a[n];
    map<lli,stack<lli>>pos;
    for(lli i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        pos[a[i]].push(i);
    }
    sort(a,a+n);
    int cur=a[0];
    map<int,bool>avail;
    for(lli i=0;i<n;i++)
    {
        if(avail[a[i]]==false)
        {
            avail[a[i]]=true;
            cur=a[i]+1;
        }
        else
        {
            int x=a[i];
            x=pos[a[i]].top();
            pos[a[i]].pop();
            a[i]=cur;
            pos[a[i]].push(x);
            avail[a[i]]=cur;
            cur++;
        }
    }
    lli b[n];
    for(lli i=0;i<n;i++)
    {
        lli x=a[i];
        lli y=pos[x].top();
        b[y]=x;
        pos[x].pop();
    }
    for(lli i=0;i<n;i++)
        cout<<b[i]<<' ';
}


#include<bits/stdc++.h>
using namespace std;
#define asgnarr(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define fast ios_base::sync_with_stdio(false)
#define loop(a,b) for(int i=a;i<b;i++)
#define mem(a,x) memset(a,x,sizeof(a))
#define pii pair<int,int>
#define psi pair<string,int>
#define pss pair<string,string>
#define pll pair<long long,long long>
#define pls pair<long long,string>
#define pis pair<int,string>
#define pcc pair<char,char>
#define pb push_back
#define all(v) v.begin(),v.end()

typedef long long lli;
typedef long li;
typedef unsigned long long ulli;
typedef unsigned long int uli;
typedef unsigned int ui;
typedef long double ld;

inline int iseven(int x){return x&1?0:1;}

inline bool is_double(double x)
{
    double y=x-(int)x;
    return (y==x?true:false);
}

li bigmod(li b,li p,lli m)
{
    if(p==0)
        return 1;
    if(p%2==0)
    {
        return (li)pow(bigmod(b,p/2,m)%m,2)%m;
    }
    return (b%m*bigmod(b,p-1,m)%m)%m;
}

map<int,int>par;
map<int,bool>avail;

lli find_par(lli x)
{
    while(avail[par[x]]==true)
    {
        par[x]=find_par(par[x]);
    }
    return par[x];
}

int main()
{
    lli n;
    scanf("%lld",&n);
    lli a[n];
    map<lli,stack<lli>>pos;
    for(lli i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        pos[a[i]].push(i);
    }
    sort(a,a+n);
    int cur=a[0];
    map<int,bool>avail;
    for(lli i=0;i<n;i++)
    {
        if(avail[a[i]]==false)
        {
            avail[a[i]]=true;
            cur=a[i]+1;
        }
        else
        {
            int x=a[i];
            x=pos[a[i]].top();
            pos[a[i]].pop();
            a[i]=cur;
            pos[a[i]].push(x);
            avail[a[i]]=cur;
            cur++;
        }
    }
    lli b[n];
    for(lli i=0;i<n;i++)
    {
        lli x=a[i];
        lli y=pos[x].top();
        b[y]=x;
        pos[x].pop();
    }
    for(lli i=0;i<n;i++)
        printf("%lld ",b[i]);
}


#include<bits/stdc++.h>
using namespace std;
#define asgnarr(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define fast ios_base::sync_with_stdio(false)
#define loop(a,b) for(int i=a;i<b;i++)
#define mem(a,x) memset(a,x,sizeof(a))
#define pii pair<int,int>
#define psi pair<string,int>
#define pss pair<string,string>
#define pll pair<long long,long long>
#define pls pair<long long,string>
#define pis pair<int,string>
#define pcc pair<char,char>
#define pb push_back
#define all(v) v.begin(),v.end()

typedef long long lli;
typedef long li;
typedef unsigned long long ulli;
typedef unsigned long int uli;
typedef unsigned int ui;
typedef long double ld;

inline int iseven(int x){return x&1?0:1;}

inline bool is_double(double x)
{
    double y=x-(int)x;
    return (y==x?true:false);
}

li bigmod(li b,li p,lli m)
{
    if(p==0)
        return 1;
    if(p%2==0)
    {
        return (li)pow(bigmod(b,p/2,m)%m,2)%m;
    }
    return (b%m*bigmod(b,p-1,m)%m)%m;
}

map<int,int>par;
map<int,bool>avail;

lli find_par(lli x)
{
    while(avail[par[x]]==true)
    {
        par[x]=find_par(par[x]);
    }
    return par[x];
}

int main()
{
    lli n;
    scanf("%lld",&n);
    lli a[n];
    map<lli,stack<lli>>pos;
    for(lli i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        par[a[i]]=a[i];
        pos[a[i]].push(i);
    }
    sort(a,a+n,greater<lli>());
    for(lli i=0;i<n;i++)
    {
        if(avail[a[i]]==false)
        {
            avail[a[i]]=true;
            par[a[i]]++;
        }
        else
        {
            lli x=find_par(a[i]);
            swap(a[i],x);
            lli y=pos[x].top();
            pos[x].pop();
            pos[a[i]].push(y);
            par[x]++;
        }
    }
    lli b[n];
    for(lli i=0;i<n;i++)
    {
        lli x=a[i];
        lli y=pos[x].top();
        b[y]=x;
        pos[x].pop();
    }
    for(lli i=0;i<n;i++)
        printf("%lld ",b[i]);
}


#include<bits/stdc++.h>
using namespace std;
struct data{
long long int x;
int p;

};
bool cmp(data a, data b)
{
    if(a.x==b.x)
    {
        return a.p<b.p;

    }
    else
    {
        return a.x<b.x;
    }
}
bool cmp1(data a, data b)
{

        return a.p<b.p;

}
int main()
{
    vector<data>v;
    int n;
    cin>>n;
    int i;
    map<long long int,int>mp,m;

    for(i=0;i<n;i++)
    {
        data d;
        scanf("%lld",&d.x);

        d.p=i;
        mp[d.x]=1;

        v.push_back(d);
    }
    sort(v.begin(),v.end(),cmp);
    long long int j;
    for(i=0;i<n;i++)
    {
        if(m[v[i].x]==0)
        {
            m[v[i].x]=1;
            j=v[i].x;

        }
        else
        {

           // cout<<j<<endl;
            while(mp[j]!=0)
            {
                j++;
            }
           // cout<<j<<endl;
            v[i].x=j;
            mp[j]=1;
            m[j]=1;

        }

    }
    sort(v.begin(),v.end(),cmp1);
    for(i=0;i<n;i++)
    {
       printf("%lld ",v[i].x);
    }
    cout<<endl;

}


#include<bits/stdc++.h>
using namespace std;
struct data{
long long int x;
int p;

};
bool cmp(data a, data b)
{
    if(a.x==b.x)
    {
        return a.p<b.p;

    }
    else
    {
        return a.x<b.x;
    }
}
bool cmp1(data a, data b)
{

        return a.p<b.p;

}
int main()
{
    vector<data>v;
    int n;
    cin>>n;
    int i;
    map<long long int,int>mp,m;

    for(i=0;i<n;i++)
    {
        data d;
        scanf("%lld",&d.x);

        d.p=i;
        mp[d.x]=1;

        v.push_back(d);
    }
    sort(v.begin(),v.end(),cmp);
    long long int j;
    for(i=0;i<n;i++)
    {
        if(m[v[i].x]==0)
        {
            m[v[i].x]=1;
            j=v[i].x;

        }
        else
        {
            v[i].x=++j;
            m[j]=1;
        }
    }
    sort(v.begin(),v.end(),cmp1);
    for(i=0;i<n;i++)
    {
       printf("%lld ",v[i].x);
    }
    cout<<endl;

}


#include<bits/stdc++.h>
using namespace std;
struct data{
long long int x;
int p;

};
bool cmp(data a, data b)
{
    if(a.x==b.x)
    {
        return a.p<b.p;

    }
    else
    {
        return a.x<b.x;
    }
}
bool cmp1(data a, data b)
{

        return a.p<b.p;

}
int main()
{
    vector<data>v;
    int n;
    cin>>n;
    int i;
    map<long long int,int>mp,m;

    for(i=0;i<n;i++)
    {
        data d;
        cin>>d.x;
        d.p=i;
        mp[d.x]=1;

        v.push_back(d);
    }
    sort(v.begin(),v.end(),cmp);
    for(i=0;i<n;i++)
    {
        if(m[v[i].x]==0)
        {
            m[v[i].x]=1;

        }
        else
        {
            long long int j=v[i].x+1;
           // cout<<j<<endl;
            while(mp[j]!=0)
            {
                j++;
            }
           // cout<<j<<endl;
            v[i].x=j;
            mp[j]=1;
            m[j]=1;

        }

    }
    sort(v.begin(),v.end(),cmp1);
    for(i=0;i<n;i++)
    {
        cout<<v[i].x<<" ";
    }
    cout<<endl;

}


#include<bits/stdc++.h>
using namespace std;
struct data{
long long int x;
int p;

};
bool cmp(data a, data b)
{
    if(a.x==b.x)
    {
        return a.p<b.p;

    }
    else
    {
        return a.x<b.x;
    }
}
bool cmp1(data a, data b)
{

        return a.p<b.p;

}
int main()
{
    vector<data>v;
    int n;
    cin>>n;
    int i;
    map<long long int,int>mp,m;

    for(i=0;i<n;i++)
    {
        data d;
        cin>>d.x;
        d.p=i;
        mp[d.x]=1;

        v.push_back(d);
    }
    sort(v.begin(),v.end(),cmp);
    long long int j;
    for(i=0;i<n;i++)
    {
        if(m[v[i].x]==0)
        {
            m[v[i].x]=1;
            j=v[i].x;

        }
        else
        {

           // cout<<j<<endl;
            while(mp[j]!=0)
            {
                j++;
            }
           // cout<<j<<endl;
            v[i].x=j;
            mp[j]=1;
            m[j]=1;

        }

    }
    sort(v.begin(),v.end(),cmp1);
    for(i=0;i<n;i++)
    {
        cout<<v[i].x<<" ";
    }
    cout<<endl;

}


#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
    #define cin cin1
    #define cout cout1
    ifstream cin("input.txt");
    ofstream cout("output.txt");
#else
#define cerr if(false)cerr
#endif
bool cmp(const pair<int,int> &l, const pair<int,int> &r)
{
	if(l.second < r.second)
		return 1;
	else
		return 0;
}
signed main()
{
    ios_base::sync_with_stdio(0);
 	int n;
 	cin >> n;
 	 vector <pair<int,int> >ar(n);
 	for(int i = 0; i < n; ++i){
 		cin >> ar[i].second;
 		ar[i].first = i;
 	}
 	sort(ar.begin(), ar.end(),cmp);
 	int mn = 1;
 	set<int> st, nums;
 	for(auto &i : ar)
 	{
 		if(mn >= i.second){
 			i.second = mn++;
 		}
 		else
 			mn = i.second + 1;

 	}
 	sort(ar.begin(), ar.end());
 	for(auto i : ar)
 		cout << i.second << " ";

}


#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
    #define cin cin1
    #define cout cout1
    ifstream cin("input.txt");
    ofstream cout("output.txt");
#else
#define cerr if(false)cerr
#endif
bool cmp(const pair<int,int> &l, const pair<int,int> &r)
{
	if(l.second > r.second)
		return 1;
	else
		return 0;
}
signed main()
{
    ios_base::sync_with_stdio(0);
 	int n;
 	cin >> n;
 	 vector <pair<int,int> >ar(n);
 	for(int i = 0; i < n; ++i){
 		cin >> ar[i].second;
 		ar[i].first = i;
 	}
 	sort(ar.begin(), ar.end(),cmp);
 	int mn = 1;
 	set<int> st, nums;
 	for(auto &i : ar)
 	{
 		if(mn >= i.second){
 			i.second = mn++;
 		}

 	}
 	sort(ar.begin(), ar.end());
 	for(auto i : ar)
 		cout << i.second << " ";

}


#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
    #define cin cin1
    #define cout cout1
    ifstream cin("input.txt");
    ofstream cout("output.txt");
#else
#define cerr if(false)cerr
#endif
bool cmp(const pair<int,int> &l, const pair<int,int> &r)
{
	if(l.second < r.second)
		return 1;
	else
		return 0;
}
signed main()
{
    ios_base::sync_with_stdio(0);
 	int n;
 	cin >> n;
 	set<int> cur;
 	 	vector <pair<int,int> >ar(n);

 	for(int i = 0; i < n; ++i){
 		cin >> ar[i].second;
 		ar[i].first = i;
 		cur.insert(ar[i].second);
 	}
 	sort(ar.begin(), ar.end(),cmp);
 	int mn = 1;
 	set<int> st, nums;
 	for(auto i : cur)
 	{
 		if(mn == i)
 		{
 			++mn;
 		}
 		else
 			nums.insert(mn);
 	}
 	for(auto &i : ar)
 	{
 		if(st.find(i.second) == st.end())
 		{
 			st.insert(i.second);
 		}
 		else{
 			i.second = *nums.begin();

 			nums.erase(nums.begin());
 		}
 	}
 	sort(ar.begin(), ar.end());
 	for(auto i : ar)
 		cout << i.second << " ";

}


// Lavina Jain
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector< ii > vii;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INF 1e9

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int main()
{
    int n;
    vector< pair<ll,int> > vp,vp2;
    //vector<ll> v;
    set<ll> s;
    int i;
    ll a;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        vp.push_back(make_pair(a,i));
    }
    sort(vp.begin(),vp.end());
    for(i=0;i<n;i++)
    {
        ll c=vp[i].first;
        while(s.count(c)!=0)
            c++;
        s.insert(c);
        vp2.push_back(make_pair(vp[i].second,c));
        /*if(s.count(vp[i].first)==0)
        {
            vp2.push_back(make_pair(vp[i].second,vp[i].first));
            s.insert(vp[i].first);
        }
        else
        {
            vp2.push_back(make_pair(vp[i].second,(vp[i].first)+1));
            s.insert((vp[i].first)+1);
        }*/
    }
    sort(vp2.begin(),vp2.end());
    for(i=0;i<n;i++)
    {
        cout<<vp2[i].second<<" ";
    }
    cout<<endl;
    return 0;
}


// Lavina Jain
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector< ii > vii;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INF 1e9

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int main()
{
    int n;
    vector< pair<ll,int> > vp,vp2;
    //vector<ll> v;
    set<ll> s;
    int i;
    ll a;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        vp.push_back(make_pair(a,i));
    }
    sort(vp.begin(),vp.end());
    set<ll>::reverse_iterator rit;
    for(i=0;i<n;i++)
    {
        ll c=vp[i].first;
        if(!s.empty())
        {
        rit=s.rbegin();
        c=max(ll(*rit)+1,c);
        }
        while(s.count(c)!=0)
            c++;
        s.insert(c);
        vp2.push_back(make_pair(vp[i].second,c));
        /*if(s.count(vp[i].first)==0)
        {
            vp2.push_back(make_pair(vp[i].second,vp[i].first));
            s.insert(vp[i].first);
        }
        else
        {
            vp2.push_back(make_pair(vp[i].second,(vp[i].first)+1));
            s.insert((vp[i].first)+1);
        }*/
    }
    sort(vp2.begin(),vp2.end());
    for(i=0;i<n;i++)
    {
        cout<<vp2[i].second<<" ";
    }
    cout<<endl;
    return 0;
}


// Lavina Jain
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector< ii > vii;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INF 1e9

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
        return (a.second < b.second);
}

int main()
{
    int n;
    vector< pair<ll,int> > vp,vp2;
    //vector<ll> v;
    set<ll> s;
    int i;
    ll a;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        vp.push_back(make_pair(a,i));
    }
    sort(vp.begin(),vp.end());
    set<ll>::reverse_iterator rit;
    for(i=0;i<n;i++)
    {
        ll c=vp[i].first;
        if(!s.empty())
        {
            rit=s.rbegin();
            c=max(ll(*rit)+1,c);
        }
        while(s.count(c)!=0)
            c++;
        s.insert(c);
        vp2.push_back(make_pair(c,vp[i].second));
        /*if(s.count(vp[i].first)==0)
          {
          vp2.push_back(make_pair(vp[i].second,vp[i].first));
          s.insert(vp[i].first);
          }
          else
          {
          vp2.push_back(make_pair(vp[i].second,(vp[i].first)+1));
          s.insert((vp[i].first)+1);
          }*/
    }
    sort(vp2.begin(),vp2.end(),sortbysec);
    for(i=0;i<n;i++)
    {
        cout<<vp2[i].first<<" ";
    }
    cout<<endl;
    return 0;
}


// Lavina Jain
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector< ii > vii;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define INF 1e9

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int main()
{
    int n;
    vector< pair<ll,int> > vp,vp2;
    //vector<ll> v;
    set<ll> s;
    int i;
    ll a;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        vp.push_back(make_pair(a,i));
    }
    sort(vp.begin(),vp.end());
    for(i=0;i<n;i++)
    {
        if(s.count(vp[i].first)==0)
        {
            vp2.push_back(make_pair(vp[i].second,vp[i].first));
            s.insert(vp[i].first);
        }
        else
        {
            vp2.push_back(make_pair(vp[i].second,(vp[i].first)+1));
            s.insert((vp[i].first)+1);
        }
    }
    sort(vp2.begin(),vp2.end());
    for(i=0;i<n;i++)
    {
        cout<<vp2[i].second<<" ";
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
map<int,int>vis;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
//    for(int i=1;i<=n;i++)
//        cout<<a[i].v<<" "<<a[i].id<<endl;
    int j;
    int t;
    a[0].v=-1;
    int pre=a[1].v;
    for(int i=1; i<=n; i++)
    {
        t=a[i].v;
        if(a[i].v==a[i-1].v)
        {
            j=max(pre,a[i].v);
            j++;
            for(;; j++)
                if(vis[j]==0)
                {
                    pre=t=j;
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=t;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
int  n;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
int vis[maxn];
int a[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        vis[a[i]]=1;
    }
    sort(a,a+n);
    int j=1;
    for(int i=1; i<n; i++)
    {
        if(a[i]==a[i-1])
        {
            for(;; j++)
                if(vis[j]==0)
                {
                    a[i]=j;
                    break;
                }
        }
    }
    n--;
    for(int i=0; i<n; i++)
        cout<<a[i]<<" ";
    cout<<a[n]<<endl;
    return 0;
}
///给你一个序列，然后每个人的礼物必须要大于等于自己现在的数并且不能和其他人一样


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
map<int,int>vis;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
//    for(int i=1;i<=n;i++)
//        cout<<a[i].v<<" "<<a[i].id<<endl;
    int j=1;
    int t;
    a[0].v=-1;
    for(int i=1; i<=n; i++)
    {
        t= a[i].v;
        if(a[i].v==a[i-1].v)
        {
            for(;; j++)
                if(vis[j]==0&&j>t)
                {
                    t=j;
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=t;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}
///给你一个序列，然后每个人的礼物必须要大于等于自己现在的数并且不能和其他人一样


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
map<int,int>vis;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
//    for(int i=1;i<=n;i++)
//        cout<<a[i].v<<" "<<a[i].id<<endl;
    int j=1;
    int t;
    a[0].v=-1;
    for(int i=1; i<=n; i++)
    {
        j=a[i].v;
        if(a[i].v==a[i-1].v)
        {
            j=a[i].v+1;
            for(;; j++)
                if(vis[j]==0)
                {
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=j;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
map<int,int>vis;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
    int j=1;
    int t;
    a[0].v=-1;
    for(int i=1; i<=n; i++)
    {
        t= a[i].v;
        if(a[i].v==a[i-1].v)
        {
            for(;; j++)
                if(vis[j]==0)
                {
                    t=j;
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=t;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}
///给你一个序列，然后每个人的礼物必须要大于等于自己现在的数并且不能和其他人一样


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
map<int,int>vis;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
//    for(int i=1;i<=n;i++)
//        cout<<a[i].v<<" "<<a[i].id<<endl;
    int j;
    int t;
    a[0].v=-1;
    int pre=a[1].v;
    for(int i=1; i<=n; i++)
    {
        t=a[i].v;
        if(a[i].v==a[i-1].v)
        {
            j=max(pre,a[i].v);
            j++;
            for(;; j++)
                if(vis[j]==0)
                {
                    j=t=j;
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=t;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=3e5+100;
const int INF=699999999;
int  n;
const int mod=1e8;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b)
{
    return a*b /gcd(a,b);
}
int vis[maxn];
struct node
{
    int v,id;
} a[maxn];
bool cmp(node a,node b)
{
    if(a.v==b.v)
        return a.id<b.id;
    return a.v<b.v;
}
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i].v;
        vis[a[i].v]=1;
        a[i].id=i;
    }
    sort(a+1,a+n+1,cmp);
    int j=1;
    int t;
    a[0].v=-1;
    for(int i=1; i<=n; i++)
    {
        t= a[i].v;
        if(a[i].v==a[i-1].v)
        {
            for(;; j++)
                if(vis[j]==0)
                {
                    t=j;
                    vis[j]=1;
                    break;
                }
        }
        ans[a[i].id]=t;
    }
    for(int i=1; i<n; i++)
        cout<<ans[i]<<" ";
    cout<<ans[n]<<endl;
    return 0;
}
///给你一个序列，然后每个人的礼物必须要大于等于自己现在的数并且不能和其他人一样


#include <bits/stdc++.h>

using namespace std;

#define DB( x ) cout << #x << " = " << x << endl;
#define LEFT(n) (2 * (n))
#define RIGHT(n) (2 * (n) + 1)
#define X real()
#define Y imag()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> node;
typedef pair<double, double> point;

const ll INF = 1e9;
const double EPS = 1e-6;
const ll MOD = (ll)(2e9 + 99);
const ll MAXV = (ll)(5e3 + 10);
const ll MAXE = (ll)(1e3 + 10);
const ll MAXLOG = (ll)(20);

int n;
unordered_map <ll, ll> tab;
unordered_map <ll, ll> nex;

ll FIND(ll u){
	if(tab.find(u) == tab.end())
		tab[u] = -1LL;
	if(tab[u] < 0)
		return u;
	return tab[u] = FIND(tab[u]);
}

ll SIZE(ll u){
	return - tab[FIND(u)];
}

ll NEX(ll u){
	u = FIND(u);
	if(nex.find(u) == nex.end())
		return nex[u] = u;
	return nex[u];
}

void JOIN(ll u, ll v){
	u = FIND(u);
	v = FIND(v);
	if(u == v)return;
	if(SIZE(v) > SIZE(u))
		swap(u, v);
	tab[u] += tab[v];
	tab[v] = u;
}

int main(){
	ios_base::sync_with_stdio(0);cin.tie( 0 );
	//freopen("a.in", "r", stdin);
	//freopen("a.out", "w", stdout);

	cin >> n;

	for(int i = 0;i < n;i ++){
		ll a;
		cin >> a;

		ll p = NEX(a);
		cout << p << "\n";
		nex[FIND(p)] = NEX(p + 1LL);
		JOIN(p, p + 1LL);
	}

	return 0;
}
/*
3
5 1	1

 */


#include <bits/stdc++.h>

using namespace std;

#define DB( x ) cout << #x << " = " << x << endl;
#define LEFT(n) (2 * (n))
#define RIGHT(n) (2 * (n) + 1)
#define X real()
#define Y imag()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> node;
typedef pair<double, double> point;

const ll INF = 1e9;
const double EPS = 1e-6;
const ll MOD = (ll)(2e9 + 99);
const ll MAXV = (ll)(5e3 + 10);
const ll MAXE = (ll)(1e3 + 10);
const ll MAXLOG = (ll)(20);

int n;
set <ll> S;

int main(){
	ios_base::sync_with_stdio(0);cin.tie( 0 );
	//freopen("a.in", "r", stdin);
	//freopen("a.out", "w", stdout);

	cin >> n;

	for(int i = 0;i < n;i ++){
		ll a;
		cin >> a;
		while(S.find(a) != S.end())a ++;
		S.insert(a);
		cout << a << "\n";
	}

	return 0;
}
/*
3
5 1	1

 */


#include <bits/stdc++.h>

using namespace std;

#define DB( x ) cout << #x << " = " << x << endl;
#define LEFT(n) (2 * (n))
#define RIGHT(n) (2 * (n) + 1)
#define X real()
#define Y imag()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> node;
typedef pair<double, double> point;

const ll INF = 1e9;
const double EPS = 1e-6;
const ll MOD = (ll)(2e9 + 99);
const ll MAXV = (ll)(5e3 + 10);
const ll MAXE = (ll)(1e3 + 10);
const ll MAXLOG = (ll)(20);

int n;
map <ll, ll> tab;
map <ll, ll> nex;

ll FIND(ll u){
	if(tab.find(u) == tab.end())
		tab[u] = -1LL;
	if(tab[u] < 0)
		return u;
	return tab[u] = FIND(tab[u]);
}

ll SIZE(ll u){
	return - tab[FIND(u)];
}

ll NEX(ll u){
	u = FIND(u);
	if(nex.find(u) == nex.end())
		return nex[u] = u;
	return nex[u];
}

void JOIN(ll u, ll v){
	u = FIND(u);
	v = FIND(v);
	if(u == v)return;
	if(SIZE(v) > SIZE(u))
		swap(u, v);
	tab[u] += tab[v];
	tab[v] = u;
}

int main(){
	ios_base::sync_with_stdio(0);cin.tie( 0 );
	//freopen("a.in", "r", stdin);
	//freopen("a.out", "w", stdout);

	cin >> n;

	for(int i = 0;i < n;i ++){
		ll a;
		cin >> a;

		ll p = NEX(a);
		cout << p << "\n";
		nex[FIND(p)] = NEX(p + 1LL);
		JOIN(p, p + 1LL);
	}

	return 0;
}
/*
3
5 1	1

 */


#include <bits/stdc++.h>

using namespace std;

#define DB( x ) cout << #x << " = " << x << endl;
#define LEFT(n) (2 * (n))
#define RIGHT(n) (2 * (n) + 1)
#define X real()
#define Y imag()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, int> node;
typedef pair<double, double> point;

const ll INF = 1e9;
const double EPS = 1e-6;
const ll MOD = (ll)(2e9 + 99);
const ll MAXV = (ll)(5e3 + 10);
const ll MAXE = (ll)(1e3 + 10);
const ll MAXLOG = (ll)(20);

int n;

vector <node> input;

int main(){
	ios_base::sync_with_stdio(0);cin.tie( 0 );
	//freopen("a.in", "r", stdin);
	//freopen("a.out", "w", stdout);

	cin >> n;

	for(int i = 0;i < n;i ++){
		ll a;
		cin >> a;
		input.push_back(node(a, i));
	}

	sort(input.begin(), input.end());

	vector <int> sol(n, 0);

	sol[input[0].second] = input[0].first;
	for(int i = 1;i < n;i ++){
		int p = input[i].second;
		ll val = input[i].first;
		sol[p] = max(val, sol[input[i - 1].second] + 1LL);
	}

	for(int i = 0;i < n;i ++)
		cout << sol[i] << "\n";

	return 0;
}
/*
3
5 1	1

 */


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
map < int , bool > vst ;
bool cmp( pair < int , int > s , pair < int , int > f ){
    if( s.second < f.second )
        return 1 ;
    return 0 ;
}

int main(){

   vector < pair < int , int > > a ;
   int n ;
   int val ;
   scanf("%d" , &n ) ;
   for( int i = 0 ; i < n ; i++ ){
     scanf("%d" , &val ) ;
     a.pb( { val , i } ) ;
   }

   sort( all( a ) );

   for( int i = 0 ; i < n ; i++ )
       if( vst [ a[ i ].first ] == 0 ){
          vst [ a[ i ].first ]  = 1 ;
       }
       else{
         int x = abs( a[ i - 1 ].first - a[ i ].first );
         while( vst [ a[ i ].first ]  ){
             a[ i ].first += ++x ;
         }
         vst [ a[ i ].first ] = 1 ;
       }

   sort( all( a ) , cmp ) ;

    for( int i = 0 ; i < n ; i++ )
        printf("%d " , a[ i ].first ) ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
map < int , bool > vst ;
bool cmp( pair < int , int > s , pair < int , int > f ){
    if( s.second < f.second )
        return 1 ;
    return 0 ;
}

int main(){

   vector < pair < int , int > > a ;
   int n ;
   int val ;
   scanf("%d" , &n ) ;
   for( int i = 0 ; i < n ; i++ ){
     scanf("%d" , &val ) ;
     a.pb( { val , i } ) ;
   }

   sort( all( a ) );

   for( int i = 0 ; i < n ; i++ )
       if( vst [ a[ i ].first ] == 0 ){
          vst [ a[ i ].first ]  = 1 ;
       }
       else{
         ll x = abs( a[ i - 1 ].first - a[ i ].first );
         while( vst [ a[ i ].first ]  ){
             a[ i ].first += ++x ;
         }
         vst [ a[ i ].first ] = 1 ;
       }

   sort( all( a ) , cmp ) ;

    for( int i = 0 ; i < n ; i++ )
        printf("%d " , a[ i ].first ) ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
map < ll , bool > vst ;
bool cmp( pair < ll , int > s , pair < ll , int > f ){
    if( s.second < f.second )
        return 1 ;
    return 0 ;
}

int main(){

   vector < pair < ll , int > > a ;
   int n ;
   ll val ;
   scanf("%d" , &n ) ;
   for( int i = 0 ; i < n ; i++ ){
     scanf("%lld" , &val ) ;
     a.pb( { val , i } ) ;
   }

   sort( all( a ) );

   for( int i = 0 ; i < n ; i++ )
       if( vst [ a[ i ].first ] == 0 ){
          vst [ a[ i ].first ]  = 1 ;
       }
       else{
         ll x = abs( a[ i - 1 ].first - a[ i ].first );
         while( vst [ a[ i ].first ]  ){
             a[ i ].first += ++x ;
         }
         vst [ a[ i ].first ] = 1 ;
       }

   sort( all( a ) , cmp ) ;

    for( int i = 0 ; i < n ; i++ )
        printf("%lld " , a[ i ].first ) ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
ll a[ N ] ;
map < ll , bool > vst ;

int main(){
   fast
   int n ;
   cin >> n ;
   for( int i = 0 ; i < n ; i++ )
     cin >> a[ i ] ;

   sort( a , a + n );

   for( int i = 0 ; i < n ; i++ ){
     if( vst [ a[ i ] ] == 0 ){
       vst [ a[ i ] ] = 1 ;
     }
     else{
        int x = abs( a[ i - 1 ] - a[ i ] ) + 1 ;
        while( vst[ a[ i ] ] ){
            a[ i ] += x++ ;
        }
        vst[ a[ i ] ] = 1 ;
     }
   }

   for( int i = 0 ; i < n ; i++ )
    cout << a[ i ] << " " ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
map < ll , bool > vst ;
bool cmp( pair < ll , int > s , pair < ll , int > f ){
    if( s.second < f.second )
        return 1 ;
    return 0 ;
}

int main(){
   fast
   vector < pair < ll , int > > a ;
   int n ;
   ll val ;
   cin >> n ;
   for( int i = 0 ; i < n ; i++ ){
     cin >> val ;
     a.pb( { val , i } ) ;
   }

   sort( all( a ) );

   for( int i = 0 ; i < n ; i++ )
       if( vst [ a[ i ].first ] == 0 ){
          vst [ a[ i ].first ]  = 1 ;
       }
       else{
         ll x = abs( a[ i - 1 ].first - a[ i ].first );
         while( vst [ a[ i ].first ]  ){
             a[ i ].first += ++x ;
         }
         vst [ a[ i ].first ] = 1 ;
       }

   sort( all( a ) , cmp ) ;

    for( int i = 0 ; i < n ; i++ )
        cout << a[ i ].first << " " ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
ll a[ N ] ;
map < ll , bool > vst ;

int main(){

   int n ;
   cin >> n ;
   for( int i = 0 ; i < n ; i++ )
     cin >> a[ i ] ;

   for( int i = 0 ; i < n ; i++ ){
     if( vst [ a[ i ] ] == 0 ){
       vst [ a[ i ] ] = 1 ;
     }
     else{
        while( vst[ ++a[ i ] ] ) ;
        vst[ a[ i ] ] = 1 ;
     }
   }

   for( int i = 0 ; i < n ; i++ )
    cout << a[ i ] << " " ;

   return 0 ;
}


#include <bits/stdc++.h>

using namespace std ;

#define sz(v) v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )

void File_input(){
freopen( "input.txt" , "r" , stdin ) ;
freopen( "output.txt" , "w" , stdout ) ;
}

void FastInputOutput(){
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

const int N = 3e5 + 5 ;
ll a[ N ] ;
map < ll , bool > vst ;

int main(){
   fast
   int n ;
   cin >> n ;
   for( int i = 0 ; i < n ; i++ )
     cin >> a[ i ] ;

   for( int i = 0 ; i < n ; i++ ){
     if( vst [ a[ i ] ] == 0 ){
       vst [ a[ i ] ] = 1 ;
     }
     else{
        int x = abs( a[ i - 1 ] - a[ i ] ) + 1 ;
        while( vst[ a[ i ] ] ){
            a[ i ] += x++ ;
        }
        vst[ a[ i ] ] = 1 ;
     }
   }

   for( int i = 0 ; i < n ; i++ )
    cout << a[ i ] << " " ;

   return 0 ;
}


#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef long long ll;
int rating , n ;
map<int , bool >visited;
vector< pair <int , int> >change , Return;
int main()
{
std::ios_base::sync_with_stdio(false);
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>rating ;
        change.push_back( mp (rating , i) );
    }
     sort ( change.begin() , change.end() );
     for(int i = 0 ;i<change.size(); i++ ){
        if(visited[change[i].first] == true )
        {
             cout<<"yup "<<change[i].first ;
            change[i].first = change[i-1].first + 1 ;
           cout<<" += "<<change[i-1].first<<" + 1"<<endl;
        }
         Return.push_back( mp (change[i].second , change[i].first) );
         visited[change[i].first] = true ;
     }
     sort(Return.begin(),Return.end());
     for(int i = 0 ; i< n; i++)cout<<Return[i].second<<' ';
    cout<<endl;
}


#include<bits/stdc++.h>
//#define mp make_pair
using namespace std;
typedef long long ll;
ll rating[300000] , n ;
map<ll , ll >mp;
vector<ll>ans;
int main()
{
std::ios_base::sync_with_stdio(false);
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>rating[i];
        ans.push_back(rating[i] + mp[rating[i]] );
        mp[rating[i]]++;
    }
    for(int i = 0 ;i<n;i++)cout<<ans[i]<<" ";
    cout<<endl;
}


#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef long long ll;
int rating , n ;
map<int , bool >visited;
vector< pair <int , int> >change , Return;
int main()
{
std::ios_base::sync_with_stdio(false);
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>rating ;
        change.push_back( mp (rating , i) );
    }
     sort ( change.begin() , change.end() );
     for(int i = 0 ;i<change.size(); i++ ){
        if(visited[change[i].first] == true )
        {
            change[i].first = change[i-1].first + 1 ;
        }
         Return.push_back( mp (change[i].second , change[i].first) );
         visited[change[i].first] = true ;
     }
     sort(Return.begin(),Return.end());
     for(int i = 0 ; i< n; i++)cout<<Return[i].second<<' ';
    cout<<endl;
}


#include<bits/stdc++.h>
//#define mp make_pair
using namespace std;
typedef long long ll;
ll rating[300000] , n ;
map<ll , bool >mp;
vector<ll>ans;
int main()
{
std::ios_base::sync_with_stdio(false);
    cin>>n;
    for(int i = 0 ;i<n ;i++){
        cin>>rating[i];
        if(mp[rating[i]] == false){
        ans.push_back(rating[i]);
        mp[rating[i]] = true;
        continue ;
        }
        while(true){
            if(mp[rating[i]] == true )rating[i]++;
            if(mp[rating[i]] == false){ans.push_back(rating[i]); mp[rating[i]] = true; break;}
        }
    }
    for(int i = 0 ;i<n;i++)cout<<ans[i]<<" ";
    cout<<endl;
}


#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <cstring>
#include <cstdlib>
#include <map>
#include <ctime>
#include <queue>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], f[1010][1010];
    ll mn=inf, mx=-inf, ans, sm=1, cnt, n, m, cur;
    bool ok, u[1000010], uu[310][310];
    char c[510][510], cc[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector <ll> g[900010];
    pair <int, int> pi [200010];
int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin>>n;

    for(int i=0;i<n;i++){
    	cin>>pi[i].F;
    	pi[i].S=i;
    }
    sort(pi, pi+n);
    mn=1;
    for(int i=0;i<n;i++){
    	if(pi[i].F<=mn){
    		pi[i].F=mn;
    		mn++;
    	}
    	else{
    		mn=pi[i].F+1;
    	}
    }
    for(int i=0;i<n;i++){
    	d[pi[i].S]=pi[i].F;
    }
    for(int i=0;i<n;i++){
    	cout<<d[i]<<' ';
    }

    return 0;
}


#include <bits/stdc++.h>
#include <string>
#include <iostream>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], f[1010][1010];
    ll mn=inf, mx=-inf, ans, sm=1, cnt, n, m, cur;
    bool ok, u[1000010], uu[310][310];
    char c[510][510], cc[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector <ll> g[900010];
    pair <int, int> pi [200010];
int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin>>n;

    for(int i=0;i<n;i++){
    	cin>>pi[i].F;
    	pi[i].S=i;
    }
    sort(pi, pi+n);
    mn=1;
    for(int i=0;i<n;i++){
    	if(pi[i].F<=mn){
    		pi[i].F=mn;
    		mn++;
    	}
    	else{
    		mn=pi[i].F+1;
    	}
    }
    for(int i=0;i<n;i++){
    	d[pi[i].S]=pi[i].F;
    }
    for(int i=0;i<n;i++){
    	cout<<d[i]<<' ';
    }

    return 0;
}


#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <cstring>
#include <cstdlib>
#include <map>
#include <ctime>
#include <queue>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], f[1010][1010];
    ll mn=inf, mx=-inf, ans, sm=1, cnt, n, m, cur;
    bool ok, u[1000010], uu[310][310];
    char c[510][510], cc[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector <ll> g[900010];
    pair <int, int> pi [200010];
int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin>>n;

    for(int i=0;i<n;i++){
    	scanf("%d", &pi[i].F);
    	pi[i].S=i;
    }
    sort(pi, pi+n);
    mn=1;
    for(int i=0;i<n;i++){
    	if(pi[i].F<=mn){
    		pi[i].F=mn;
    		mn++;
    	}
    	else{
    		mn=pi[i].F+1;
    	}
    }
    for(int i=0;i<n;i++){
    	d[pi[i].S]=pi[i].F;
    }
    for(int i=0;i<n;i++){
    	cout<<d[i]<<' ';
    }

    return 0;
}


#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <cstring>
#include <cstdlib>
#include <map>
#include <ctime>
#include <queue>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], f[1010][1010];
    ll mn=inf, mx=-inf, ans, sm=1, cnt, n, m, cur;
    bool ok, u[1000010], uu[310][310];
    char c[510][510], cc[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector <ll> g[900010];
    pair <int, int> pi [300010];
int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin>>n;

    for(int i=0;i<n;i++){
    	cin>>pi[i].F;
    	pi[i].S=i;
    }
    sort(pi, pi+n);
    mn=1;
    for(int i=0;i<n;i++){
    	if(pi[i].F<=mn){
    		pi[i].F=mn;
    		mn++;
    	}
    	else{
    		mn=pi[i].F+1;
    	}
    }
    for(int i=0;i<n;i++){
    	d[pi[i].S]=pi[i].F;
    }
    for(int i=0;i<n;i++){
    	cout<<d[i]<<' ';
    }

    return 0;
}


/*input

*/
#include <chrono>
#include <random>
#include <cmath>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <functional>

using namespace std;

#define Fi              first
#define Se              second
#define S(n)            cin >> n
#define P(n)            cout << n
#define pb              push_back
#define pp              pop_back
#define pf              pop_front
#define sp              cout << " "
#define nl              cout << "\n"
#define MIN(con)        (*min_element(ALL(con)))
#define MAX(con)        (*max_element(ALL(con)))
#define mem(n, a)       memset((n), (a), sizeof(n))
#define ALL(cont)       (cont).begin(),(cont).end()
#define NX(cont)        next_permutation(ALL(cont))
#define PX(cont)        prev_permutation(ALL(cont))
#define F(i, n, r)      for(int i = (n); i < (r); i ++)
#define prec(n)         cout << fixed << setprecision(n)
#define PI              3.14159265358979323846264338327951
#define fast            ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define FH(it,c)        for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++ it)

using ll = long long;
using ld = long double;
using ss = stringstream;
using ul = unsigned long long;

template < typename T > inline T LCM(T a, T b)            { return (a * b) / GCD(a, b); }
template < typename T > inline T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > inline T _max(T a, T b, T c)      { return max( max( a, b ), c ); }
template < typename T > inline T _min(T a, T b, T c)      { return min( min( a, b ), c ); }
template < typename T > inline string toString(T a)       {return to_string(a); }  // Convert int to string
template < typename T > inline void toInt(string s, T &x) { ss str(s); str >> x;}  // Convert string to int

inline void lower(string &s) {
  FH(it,s)
    *it = tolower(*it);
}

inline void upper(string &s) {
  FH(it,s)
    *it = toupper(*it);
}

const int mod = 1e9 + 7;

inline ll add(ll x, ll y) { x += y; if(x >= mod) x -= mod; return x; }
inline ll sub(ll x, ll y) { x -= y; if(x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod; }

inline ll powr(ll a, ll b){
    ll x = 1LL;
    while(b) {
        if(b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}

inline ll inv(ll a) { return powr(a, mod - 2);}

const int inv2 = (mod + 1) >> 1;
const ll inf    =  999999999999999999;

bool palin(string s)
{
    string s1 = s;
    reverse(s.begin(), s.end());
    return (s == s1);
}

ll triangle(ll n)
{
    return (n * (n + 1)) / 2;
}

bool check(ll n)
{
    if(n == 1) return 0;
    if(n == 2 or n == 3) return 1;
    if(n % 2 == 0 or n % 3 == 0) return 0;

    for(ll i = 5; i * i <= n; i += 6) if(n % i == 0 or n % (i + 2) == 0) return 0;
    return 1;
}

map < ll, ll > parent;

ll explore(ll x)
{
    while(parent[x] > 0) {
        x = parent[x];
    }
    return x;
}

void merge(ll a, ll b)
{
    a = explore(a);
    b = explore(b);
    parent[a] = b;
}

int main ()
{
    fast;
    int n;
    cin >> n;
    vector < ll > v(n);
    for(int i = 0; i < n; i ++) {
        cin >> v[i];
    }

    map < ll, int > m;
    for(int i = 0; i < n; i ++) {
        ll x = explore(v[i]);
        if(x == v[i]) {
            cout << v[i] << " ";
            /*while(parent[x + 1] > 0) {
                x = explore(x + 1);
            }*/
            merge(v[i], x + 1);
        }
        else {
            cout << x << " ";
            merge(v[i], x + 1);
        }
    }
    nl;
    return 0;
}


/*input
3
5 1 1
*/
#include <chrono>
#include <random>
#include <cmath>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <functional>

using namespace std;

#define Fi              first
#define Se              second
#define S(n)            cin >> n
#define P(n)            cout << n
#define pb              push_back
#define pp              pop_back
#define pf              pop_front
#define sp              cout << " "
#define nl              cout << "\n"
#define MIN(con)        (*min_element(ALL(con)))
#define MAX(con)        (*max_element(ALL(con)))
#define mem(n, a)       memset((n), (a), sizeof(n))
#define ALL(cont)       (cont).begin(),(cont).end()
#define NX(cont)        next_permutation(ALL(cont))
#define PX(cont)        prev_permutation(ALL(cont))
#define F(i, n, r)      for(int i = (n); i < (r); i ++)
#define prec(n)         cout << fixed << setprecision(n)
#define PI              3.14159265358979323846264338327951
#define fast            ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define FH(it,c)        for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++ it)

using ll = long long;
using ld = long double;
using ss = stringstream;
using ul = unsigned long long;

template < typename T > inline T LCM(T a, T b)            { return (a * b) / GCD(a, b); }
template < typename T > inline T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > inline T _max(T a, T b, T c)      { return max( max( a, b ), c ); }
template < typename T > inline T _min(T a, T b, T c)      { return min( min( a, b ), c ); }
template < typename T > inline string toString(T a)       {return to_string(a); }  // Convert int to string
template < typename T > inline void toInt(string s, T &x) { ss str(s); str >> x;}  // Convert string to int

inline void lower(string &s) {
  FH(it,s)
    *it = tolower(*it);
}

inline void upper(string &s) {
  FH(it,s)
    *it = toupper(*it);
}

const int mod = 1e9 + 7;

inline ll add(ll x, ll y) { x += y; if(x >= mod) x -= mod; return x; }
inline ll sub(ll x, ll y) { x -= y; if(x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod; }

inline ll powr(ll a, ll b){
    ll x = 1LL;
    while(b) {
        if(b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}

inline ll inv(ll a) { return powr(a, mod - 2);}

const int inv2 = (mod + 1) >> 1;
const ll inf    =  999999999999999999;

bool palin(string s)
{
    string s1 = s;
    reverse(s.begin(), s.end());
    return (s == s1);
}

ll triangle(ll n)
{
    return (n * (n + 1)) / 2;
}

bool check(ll n)
{
    if(n == 1) return 0;
    if(n == 2 or n == 3) return 1;
    if(n % 2 == 0 or n % 3 == 0) return 0;

    for(ll i = 5; i * i <= n; i += 6) if(n % i == 0 or n % (i + 2) == 0) return 0;
    return 1;
}

int main ()
{
    fast;
    int n;
    cin >> n;
    vector < pair < ll, int > > v(n);
    for(int i = 0; i < n; i ++) {
        cin >> v[i].first;
        v[i].second = i;
    }
    sort(ALL(v));
    ll cnt = 1;
    for(int i = 0; i < n; i ++) {
        cnt = max(cnt, v[i].first);
        if(v[i].first == cnt) {
            cnt ++;
        }
        else {
            v[i].first = cnt;
            cnt ++;
        }
    }
    sort(ALL(v), [](pair < ll, int > a, pair < ll, int > b) {
        return a.second < b.second;
    });
    for(auto x: v) {
        cout << x.first << " ";
    }
    nl;
    return 0;
}


/*input

*/
#include <chrono>
#include <random>
#include <cmath>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <functional>

using namespace std;

#define Fi              first
#define Se              second
#define S(n)            cin >> n
#define P(n)            cout << n
#define pb              push_back
#define pp              pop_back
#define pf              pop_front
#define sp              cout << " "
#define nl              cout << "\n"
#define MIN(con)        (*min_element(ALL(con)))
#define MAX(con)        (*max_element(ALL(con)))
#define mem(n, a)       memset((n), (a), sizeof(n))
#define ALL(cont)       (cont).begin(),(cont).end()
#define NX(cont)        next_permutation(ALL(cont))
#define PX(cont)        prev_permutation(ALL(cont))
#define F(i, n, r)      for(int i = (n); i < (r); i ++)
#define prec(n)         cout << fixed << setprecision(n)
#define PI              3.14159265358979323846264338327951
#define fast            ios_base:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define FH(it,c)        for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++ it)

using ll = long long;
using ld = long double;
using ss = stringstream;
using ul = unsigned long long;

template < typename T > inline T LCM(T a, T b)            { return (a * b) / GCD(a, b); }
template < typename T > inline T GCD(T a, T b)            { ll t; while(a) { t = a; a = b % a; b = t; } return b; }
template < typename T > inline T _max(T a, T b, T c)      { return max( max( a, b ), c ); }
template < typename T > inline T _min(T a, T b, T c)      { return min( min( a, b ), c ); }
template < typename T > inline string toString(T a)       {return to_string(a); }  // Convert int to string
template < typename T > inline void toInt(string s, T &x) { ss str(s); str >> x;}  // Convert string to int

inline void lower(string &s) {
  FH(it,s)
    *it = tolower(*it);
}

inline void upper(string &s) {
  FH(it,s)
    *it = toupper(*it);
}

const int mod = 1e9 + 7;

inline ll add(ll x, ll y) { x += y; if(x >= mod) x -= mod; return x; }
inline ll sub(ll x, ll y) { x -= y; if(x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return ((x % mod) * (y % mod)) % mod; }

inline ll powr(ll a, ll b){
    ll x = 1LL;
    while(b) {
        if(b & 1) x = mul(x, a);
        a = mul(a, a);
        b >>= 1;
    }
    return x;
}

inline ll inv(ll a) { return powr(a, mod - 2);}

const int inv2 = (mod + 1) >> 1;
const ll inf    =  999999999999999999;

bool palin(string s)
{
    string s1 = s;
    reverse(s.begin(), s.end());
    return (s == s1);
}

ll triangle(ll n)
{
    return (n * (n + 1)) / 2;
}

bool check(ll n)
{
    if(n == 1) return 0;
    if(n == 2 or n == 3) return 1;
    if(n % 2 == 0 or n % 3 == 0) return 0;

    for(ll i = 5; i * i <= n; i += 6) if(n % i == 0 or n % (i + 2) == 0) return 0;
    return 1;
}

map < ll, ll > parent;

ll explore(ll x)
{
    if(parent[x] == 0) {
        return x;
    }
    return parent[x] = explore(parent[x]);
}

void merge(ll a, ll b)
{
    a = explore(a);
    b = explore(b);
    parent[a] = b;
}

int main ()
{
    fast;
    int n;
    cin >> n;
    vector < ll > v(n);
    for(int i = 0; i < n; i ++) {
        cin >> v[i];
    }

    map < ll, int > m;
    for(int i = 0; i < n; i ++) {
        ll x = explore(v[i]);
        if(x == v[i]) {
            cout << v[i] << " ";
            /*while(parent[x + 1] > 0) {
                x = explore(x + 1);
            }*/
            merge(v[i], x + 1);
        }
        else {
            cout << x << " ";
            merge(v[i], x + 1);
        }
    }
    nl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

pair<long,long>s[300000];
long long n,s1[300000];
cin>>n;

for(int i=0;i<n;i++){
    cin>>s[i].first;
    s[i].second=i;
}
sort(s,s+n);

for(int i=1;i<n;i++){
    if(s[i].first=s[i-1].first){
        s[i].first++;
    }
}

for(int i=0;i<n;i++){
    s1[s[i].second]=s[i].first;
}

for(int i=0;i<n;i++){
    cout<<s1[i]<<" ";
}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

pair<long,long>s[300000];
long long n,s1[300000];
cin>>n;

for(int i=0;i<n;i++){
    cin>>s[i].first;
    s[i].second=i;
}
sort(s,s+n);

for(int i=1;i<n;i++){
    if(s[i].first==s[i-1].first){
        s[i].first++;
    }
}

for(int i=0;i<n;i++){
    s1[s[i].second]=s[i].first;
}

for(int i=0;i<n;i++){
    cout<<s1[i]<<" ";
}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

pair<long,long>s[300000];
long long n,s1[300000];
cin>>n;

for(int i=0;i<n;i++){
    cin>>s[i].first;
    s[i].second=i;
}
sort(s,s+n);

for(int i=1;i<n;i++){
 if(s[i].first<=s[i-1].first){
   s[i].first=s[i-1].first;
   s[i].first++;
 }
}

for(int i=0;i<n;i++){
        s1[s[i].second]=s[i].first;

}
for(int i=0;i<n;i++){

    cout<<s1[i]<<" ";
}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

pair<long,long>s[30000];
long long n,s1[30000];
cin>>n;

for(int i=0;i<n;i++){
    cin>>s[i].first;
    s[i].second=i;
}
sort(s,s+n);

for(int i=1;i<n;i++){
 if(s[i].first<=s[i-1].first){
   s[i].first=s[i-1].first;
   s[i].first++;
 }
}

for(int i=0;i<n;i++){
        s1[s[i].second]=s[i].first;

}
for(int i=0;i<n;i++){

    cout<<s1[i]<<" ";
}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

pair<long,long>s[300000];
long long n,s1[300000];
cin>>n;

for(int i=0;i<n;i++){
    cin>>s[i].first;
    s[i].second=i;
}
sort(s,s+n);

for(int i=1;i<n;i++){
    if(s[i].first<=s[i-1].first){
        s[i].first++;
    }
}

for(int i=0;i<n;i++){
    s1[s[i].second]=s[i].first;
}

for(int i=0;i<n;i++){
    cout<<s1[i]<<" ";
}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
bool com(pair<long int ,long int>p,pair<long int,long int>q)
{
	return(p.second<q.second);
}
int main()
{
	long int n;
	cin>>n;
	vector<pair<long int,long int> >p;
	//vector<bool>v;
	for(int i=1;i<=n;i++)
	{
		int x;cin>>x;
		//v[x]=false;
		p.push_back({x,i});
	}
	sort(p.begin(),p.end());
	for(long int i=1;i<(long int)p.size();i++)
	{

		if(p[i].first==p[i-1].first)
		{
			p[i].first++;
		}
		else if((p[i-1].first-p[i].first)==p[i-2].first)
		p[i].first=p[i-1].first+1;
	}
	sort(p.begin(),p.end(),com);
	for(long int i=0;i<(long int)p.size();i++)
	{
		cout<<p[i].first<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
bool com(pair<long int ,long int>p,pair<long int,long int>q)
{
	return(p.second<q.second);
}
int main()
{
	long int n;
	cin>>n;
	vector<pair<long int,long int> >p;
	//vector<bool>v;
	for(int i=1;i<=n;i++)
	{
		int x;cin>>x;
		//v[x]=false;
		p.push_back({x,i});
	}
	sort(p.begin(),p.end());
	vector<int>te;
	te.push_back(p[0].F);
	int co=p[0].F;
	co++;
	for(int i=1;i<n;i++)
	{
		if(p[i].F==p[i-1].F)
		{
			te.pb(co);
			++co;
		}
		else if(p[i].F!=p[i-1].F){
			if(p[i].F<co)
			{
				te.pb(co);
				++co;
			}
			else
			{
				co=p[i].F+1;
				te.pb(p[i].F);
				}
			}
		}
		//for(int i=0;i<n;i++)
		//cout<<te[i]<<" ";
		for(int i=0;i<n;i++)
		{
			p[i].F=te[i];
		}
		sort(p.begin(),p.end(),com);
		for(int i=0;i<n;i++)
		cout<<p[i].first<<" ";
	}


#include<bits/stdc++.h>
using namespace std;
bool com(pair<int ,int>p,pair<int,int>q)
{
	return(p.second<q.second);
}
int main()
{
	long int n;
	cin>>n;
	vector<pair<int,int> >p;
	//vector<bool>v;
	for(int i=1;i<=n;i++)
	{
		int x;cin>>x;
		//v[x]=false;
		p.push_back({x,i});
	}
	sort(p.begin(),p.end());
	for(int i=1;i<(int)p.size();i++)
	{

		if(p[i].first==p[i-1].first)
		{
			p[i].first++;
		}
		else if((p[i-1].first-p[i].first)==p[i-2].first)
		p[i].first=p[i-1].first+1;
	}
	sort(p.begin(),p.end(),com);
	for(int i=0;i<(int)p.size();i++)
	{
		cout<<p[i].first<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
bool com(pair<int ,int>p,pair<int,int>q)
{
	return(p.second<q.second);
}
int main()
{
	long int n;
	cin>>n;
	vector<pair<int,int> >p;
	for(int i=1;i<=n;i++)
	{
		int x;cin>>x;
		p.push_back({x,i});
	}
	sort(p.begin(),p.end());
	for(int i=1;i<(int)p.size();i++)
	{
		if(p[i].first==p[i-1].first)
		{
			p[i].first++;
		}
	}
	sort(p.begin(),p.end(),com);
	for(int i=0;i<(int)p.size();i++)
	{
		cout<<p[i].first<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
map<int,int> m;
int f(int k)
{
	if(m.find(k)==m.end())return k;
  	else return m[k]=f(m[k]);
}
int main()
{
	int n,a,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		j=f(a);
		printf("%d ",j);
		m[j]=j+1;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<long,long>mp;
set<long>s;
int f(long x){
	if(s.find(x) == s.end())
	    return x;
	return
	    mp[x]=f(mp[x]);
}
int main(){

	long n,a;
	cin>>n;
	for(long i=0;i<n;i++){
		cin>>x;
		cout<<x<<" ";
		x=f(x);
		cout<<x<<endl;
		mp[x]=x+1;
		//cout<<x<<" ";
		s.insert(x);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<int,int>m;
int f(int k){
	if(m.find(k)==m.end())
	    return k;
  	else
  	    return m[k]=f(m[k]);
}
int main(){
	int n,a,g;
	cin>>n;

	for(auto i=0;i<n;i++){
	    cin>>a;
	    g=f(a);
		printf("%d ",g);
		m[g]=g+1;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<long,long>mp;
int f(long x){
	if(mp.find(x) == mp.end())
	    return x;
	return
	    mp[x]=f(mp[x]);
}
int main(){

	long n,x;
	cin>>n;
	for(long i=0;i<n;i++){
		cin>>x;
		//cout<<x<<" ";
		x=f(x);
		//cout<<x<<endl;
		mp[x]=x+1;
		cout<<x<<" ";
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
long x;
set<long>s;
map<long,long>m;
int main(){
    long n;
    cin >> n;
    for(long i = 0; i < n; i++){
        cin>>x;

        if(s.find(x) == s.end()){
            cout<<x<<" ";
            s.insert(x);
            m[x]=x+1;
        }
        else{
            cout<<m[x]<<" ";
            s.insert(m[x]);
            m[x]++;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
long x;
set<long>s;
int main(){
    long n;
    cin >> n;
    for(long i = 0; i < n; i++){
        cin>>x;
        if(s.find(x) == s.end()){
            cout<<x<<" ";
            s.insert(x);
        }
        else{
            while(s.find(x) != s.end()){
                x++;
            }
            cout<<x<<" ";
            s.insert(x);
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
map<long,long>mp;
set<long>s;
int f(long x){
	if(s.find(x) == s.end())
	    return x;
	return
	    mp[x]=f(mp[x]);
}
int main(){

	long n,x;
	cin>>n;
	for(long i=0;i<n;i++){
		cin>>x;
		cout<<x<<" ";
		x=f(x);
		cout<<x<<endl;
		mp[x]=x+1;
		//cout<<x<<" ";
		s.insert(x);
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<long,long>mp;
set<long>s;
int f(long x){
	if(s.find(x) == s.end())
	    return x;
	return
	    mp[x]=f(mp[x]);
}
int main(){

	long n,x;
	cin>>n;
	for(long i=0;i<n;i++){
		cin>>x;
		//cout<<x<<" ";
		x=f(x);
		//cout<<x<<endl;
		mp[x]=x+1;
		cout<<x<<" ";
		s.insert(x);
	}

	return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

for (int i=1;i<=1000000;i++)
    if (!mapa[i])v.push_back(i);

 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);

return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);
for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=2000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);

for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=1000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}

sort(v.begin(),v.end());
/* for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
    */
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n;
pair< long long ,long long >a[1000000+100];
map< long long ,int >mapa;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)  scanf("%lld",&a[i].first),mapa[a[i].first]++,a[i].second=i;

    long long cnt=1;
    sort(a+1,a+n+1);
    for (int i=1;i<=n;i++)
    {
        if (mapa[a[i].first]>1){
            if (a[i].first>cnt) {cnt=a[i].first+1;continue;}
            while(mapa[cnt])cnt++;
             mapa[a[i].first]--;
            a[i].first=cnt;
            mapa[cnt]++;
        }
    }
for (int i=1;i<=n;i++)swap(a[i].first,a[i].second);
sort(a+1,a+n+1);
for (int i=1;i<=n;i++)printf("%lld ",a[i].second);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n;
pair< long long ,long long >a[1000000+100];
map< long long ,int >mapa;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)  scanf("%lld",&a[i].first),mapa[a[i].first]++,a[i].second=i;

    long long cnt=1;
    sort(a+1,a+n+1);
    for (int i=1;i<=n;i++)
    {
        cnt=a[i].first+1;
        if (mapa[a[i].first]>1){
            while(mapa[cnt])cnt++;
             mapa[a[i].first]--;
            a[i].first=cnt;
            mapa[cnt]++;
        }
    }
for (int i=1;i<=n;i++)swap(a[i].first,a[i].second);
sort(a+1,a+n+1);
for (int i=1;i<=n;i++)printf("%lld ",a[i].second);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);
for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=2000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
sort(v.begin(),v.end());
 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);
for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=1000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
sort(v.begin(),v.end());
 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);
for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=2000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
sort(v.begin(),v.end());
 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);

for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=1000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
cout<<v.size()<<endl;//\
sort(v.begin(),v.end());
/* for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
    */
return 0;
}


#include<cstdio>
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[1000000+100];
map< int , int >mapa;
vector< int >v;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        mapa[a[i]]++;
    }

if (!mapa[1])v.push_back(1);

for (int i=2;i<=1000000;i++)
{
    if (!mapa[i])
    {
        int p=i;
        while(p<=1000000)
        {
            v.push_back(p);
            p+=i;
        }
    }
}
/*
sort(v.begin(),v.end());
 for (int i=1;i<=n;i++)
     if (mapa[a[i]]>1) mapa[a[i]]--,a[i]=v[0],v.erase(v.begin());

 for (int i=1;i<=n;i++) printf("%d ",a[i]);
    */
return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
using namespace std;
const int maxn=3e5+10;
typedef long long ll;
ll gcd(ll x,ll y)
{
    return x?gcd(y%x,x):y;
}
ll lcm(ll x,ll y)
{
    return x*y/gcd(x,y);
}
ll lowbit(ll x)
{
    return x&(-x);
}
ll a[maxn];
ll vis[maxn];
bool cmp(int x,int y)
{
    return a[x]<a[y];
}
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        ll p=0;
        for(int i=0; i<n; i++)
            cin>>a[i],vis[i]=i;
        sort(vis,vis+n,cmp);
        for(int i=0; i<n; i++)
        {
            p=max(p+1,a[vis[i]]);
            a[vis[i]]=p;
        }
        for(int i=0; i<n; i++)
            printf("%lld ",a[i]);
        printf("\n");
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
using namespace std;
const int maxn=3e5+10;
typedef long long ll;
ll gcd(ll x,ll y){return x?gcd(y%x,x):y;}
ll lcm(ll x,ll y){return x*y/gcd(x,y);}
ll lowbit(ll x){return x&(-x);}
ll a[maxn];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        map<ll,ll>vis;
        for(int i=0;i<n;i++)
            cin>>a[i];
        for(int i=0;i<n;i++)
        {
            vis[a[i]]++;
            printf("%lld ",a[i]+vis[a[i]]-1);
        }
        printf("\n");
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
using namespace std;
const int maxn=3e5+10;
typedef long long ll;
ll gcd(ll x,ll y)
{
    return x?gcd(y%x,x):y;
}
ll lcm(ll x,ll y)
{
    return x*y/gcd(x,y);
}
ll lowbit(ll x)
{
    return x&(-x);
}
ll a[maxn];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        map<ll,ll>vis;
        for(int i=0; i<n; i++)
            cin>>a[i];
        for(int i=0; i<n; i++)
        {
            while(vis[a[i]]==1)
            {
                a[i]++;
            }
            vis[a[i]]=1;
        }
        for(int i=0;i<n;i++)
        {
            cout<<a[i]<<" ";
        }
        printf("\n");
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define rep(i, x, n) for (int i = x; i < n; i++)
#define rev(A) reverse((A).begin(), (A).end())
#define sorv(A) sort((A).begin(), (A).end())
using namespace std;
int main(){
 int n,x;
 cin >> n;
 int a[n],b[n];
 rep(i,0,n){
   cin >> a[i];
   b[i] = a[i];
 }
 sort (b,b+n);
 int maxi = b[n-1];
 int ele = 1;
 while(ele<=maxi){
    x = ele-1;
    rep(i,0,n){
    if (a[i] == ele){
        x++;
        a[i] = x;

    }

    }
    ele++;

 }
 rep(i,0,n){
   cout << a[i] << " ";
 }

}


#include<bits/stdc++.h> // 68 79 "Baklol"
using namespace std;

#define rep(x, k, n)    for(int x = (k); x < (n); ++x)
#define repr(x, k, n)   for(int x = (k); x > (n); --x)
#define tr(it, a)       for(auto it = (a).begin(); it != (a).end(); ++it)
#define ll              long long
#define siz(x)          ((int)(x).size())
#define print(x)        cout << (x) << '\n'
#define prints(x)       cout << (x) << " "
#define eb              emplace_back
#define mp              make_pair
#define F               first
#define S               second
#define o2(x)           ( (x) * (x) )
#define all(x)          (x).begin(), (x).end()
#define allr(x)         (x).rbegin(), (x).rend()
#define clr(x, k)       memset(x, k, sizeof(x))
#define sortall(x)      sort(all(x))
#define sortalld(x)     sort(all(x), greater<int>())
#define printv(v)       rep(x, 0, siz(v)){ prints(v[x]); } cout << '\n'
#define print2dv(V)     rep(y, 0, siz(V)){ printv(V[y]); }
#define out(x)          cout << ((x) ? "Yes" : "No") << '\n';
#define inf             INT_MAX
#define ninf            INT_MIN
#define int             long long // take care of it when too much computation required

typedef pair<int, int>  pii;
typedef vector<int>     vi;
typedef vector<bool>    vb;
typedef vector<pii>     vpii;
typedef vector<vi>      vvi;
typedef vector<vb>      vvb;

template <typename Arg1>
void debug_out(const char* name, Arg1&& arg1){
    cout << name << " = " << arg1  << " ]" << '\n';
}
template <typename Arg1, typename... Args>
void debug_out(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " = " << arg1 <<",";
    debug_out(comma+1, args...);
}

#ifndef ONLINE_JUDGE
#define deb(...) cout << "[ ", debug_out(#__VA_ARGS__, __VA_ARGS__)
#else
#define deb(...)
#endif

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());

const int mod = 1e9+7; // 998244353
const int N = 3e5, M = N;

/*
-> Do not forget to check the edge cases.
-> Do something instead of nothing.
-> Make sure you are submitting the right file.
-> Do not make "easy->complicated", xd... :|.
*/

//-----------------------------------------------------------------------------

int check(int diff, vi temp){
    vi v = temp;
    int res = inf, cnt = 0;
    int n = siz(v);
    rep(i, 1, n){
        int d = v[i] - v[i-1];
        if(d > diff){
            d -= diff;
            if(d >= 2){
                if(d == 2 && i == 1){
                    v[i]--;
                    v[i-1]++;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                v[i]--;
                cnt++;
            }
        }
        else if(d < diff){
            d = diff - d;
            if(d >= 2){
                if(d == 2 && i == 1){
                    v[i]++;
                    v[i-1]--;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                v[i]++;
                cnt++;
            }
        }
    }
    res = min(res, cnt);
    cnt = 0;
    repr(i, n-1, 0){
        int d = temp[i] - temp[i-1];
        if(d > diff){
            d -= diff;
            if(d >= 2){
                if(d == 2 && i == n-1){
                    temp[i]--;
                    temp[i-1]++;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                temp[i]--;
                cnt++;
            }
        }
        else if(d < diff){
            d = diff - d;
            if(d >= 2){
                if(d == 2 && i == n-1){
                    temp[i]++;
                    temp[i-1]--;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                temp[i]++;
                cnt++;
            }
        }
    }
    // deb(res, cnt);
    res = min(res, cnt);
    // deb(diff, res);
    return res;
}

void Solve_main() {

    int n;
    cin >> n;
    vi v(n);
    rep(i, 0, n){
        cin >> v[i];
    }
    if(n == 1){
        cout << 0 << '\n';
        return;
    }
    if(v.back() < v.front()){
        reverse(all(v));
    }
    // printv(v);
    int diffsum = 0;
    rep(i, 1, n){
        diffsum += v[i] - v[i-1];
        deb(v[i] - v[i-1]);
    }
    deb(diffsum);
    int diff1 = diffsum / (n - 1);
    int diff2 = (diffsum + n - 2) / (n - 1);
    deb(diff1, diff2);
    int res = check(diff2, v);
    res = min(res, check(diff1, v));
    if(res >= inf){
        cout << -1 << '\n';
    }
    else{
        cout << res << '\n';
    }

}

//-----------------------------------------------------------------------------

int32_t main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    // cout << setprecision(12) << fixed;
    int tc = 1;
    // cin >> tc;
    for(int i = 0; i < tc; i++) {
        Solve_main();
    }

    cerr << "[time:" << 1.0*clock()/CLOCKS_PER_SEC << "s] ";
    return 0;
}


#include<bits/stdc++.h> // 68 79 "Baklol"
using namespace std;

#define rep(x, k, n)    for(int x = (k); x < (n); ++x)
#define repr(x, k, n)   for(int x = (k); x > (n); --x)
#define tr(it, a)       for(auto it = (a).begin(); it != (a).end(); ++it)
#define ll              long long
#define siz(x)          ((int)(x).size())
#define print(x)        cout << (x) << '\n'
#define prints(x)       cout << (x) << " "
#define eb              emplace_back
#define mp              make_pair
#define F               first
#define S               second
#define o2(x)           ( (x) * (x) )
#define all(x)          (x).begin(), (x).end()
#define allr(x)         (x).rbegin(), (x).rend()
#define clr(x, k)       memset(x, k, sizeof(x))
#define sortall(x)      sort(all(x))
#define sortalld(x)     sort(all(x), greater<int>())
#define printv(v)       rep(x, 0, siz(v)){ prints(v[x]); } cout << '\n'
#define print2dv(V)     rep(y, 0, siz(V)){ printv(V[y]); }
#define out(x)          cout << ((x) ? "Yes" : "No") << '\n';
#define inf             INT_MAX
#define ninf            INT_MIN
#define int             long long // take care of it when too much computation required

typedef pair<int, int>  pii;
typedef vector<int>     vi;
typedef vector<bool>    vb;
typedef vector<pii>     vpii;
typedef vector<vi>      vvi;
typedef vector<vb>      vvb;

template <typename Arg1>
void debug_out(const char* name, Arg1&& arg1){
    cout << name << " = " << arg1  << " ]" << '\n';
}
template <typename Arg1, typename... Args>
void debug_out(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " = " << arg1 <<",";
    debug_out(comma+1, args...);
}

#ifndef ONLINE_JUDGE
#define deb(...) cout << "[ ", debug_out(#__VA_ARGS__, __VA_ARGS__)
#else
#define deb(...)
#endif

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());

const int mod = 1e9+7; // 998244353
const int N = 3e5, M = N;

/*
-> Do not forget to check the edge cases.
-> Do something instead of nothing.
-> Make sure you are submitting the right file.
-> Do not make "easy->complicated", xd... :|.
*/

//-----------------------------------------------------------------------------

int check(int diff, vi temp){
    vi v = temp;
    int res = inf, cnt = 0;
    int n = siz(v);
    rep(i, 1, n){
        int d = v[i] - v[i-1];
        if(d > diff){
            d -= diff;
            if(d >= 2){
                if(d == 2 && i == 1){
                    v[i]--;
                    v[i-1]++;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                v[i]--;
                cnt++;
            }
        }
        else if(d < diff){
            d = diff - d;
            if(d >= 2){
                if(d == 2 && i == 1){
                    v[i]++;
                    v[i-1]--;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                v[i]++;
                cnt++;
            }
        }
    }
    res = min(res, cnt);
    cnt = 0;
    repr(i, n-1, 0){
        int d = temp[i] - temp[i-1];
        if(d > diff){
            d -= diff;
            if(d >= 2){
                if(d == 2 && i == n-1){
                    temp[i]--;
                    temp[i-1]++;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                temp[i-1]++;
                cnt++;
            }
        }
        else if(d < diff){
            d = diff - d;
            if(d >= 2){
                if(d == 2 && i == n-1){
                    temp[i]++;
                    temp[i-1]--;
                    cnt += 2;
                }
                else{
                    cnt = inf;
                    break;
                }
            }
            else if(d == 1){
                temp[i-1]--;
                cnt++;
            }
        }
    }
    res = min(res, cnt);
    return res;
}

void Solve_main() {

    int n;
    cin >> n;
    vi v(n);
    rep(i, 0, n){
        cin >> v[i];
    }
    if(n == 1){
        cout << 0 << '\n';
        return;
    }
    if(v.back() < v.front()){
        reverse(all(v));
    }
    int diffsum = 0;
    rep(i, 1, n){
        diffsum += v[i] - v[i-1];
    }
    int diff1 = diffsum / (n - 1);
    int diff2 = (diffsum + n - 2) / (n - 1);
    int res = check(diff2, v);
    res = min(res, check(diff1, v));
    if(res >= inf){
        cout << -1 << '\n';
    }
    else{
        cout << res << '\n';
    }

}

//-----------------------------------------------------------------------------

int32_t main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    // cout << setprecision(12) << fixed;
    int tc = 1;
    // cin >> tc;
    for(int i = 0; i < tc; i++) {
        Solve_main();
    }

    cerr << "[time:" << 1.0*clock()/CLOCKS_PER_SEC << "s] ";
    return 0;
}


#include<bits/stdc++.h> // 68 79 "Baklol"
using namespace std;

#define rep(x, k, n)    for(int x = (k); x < (n); ++x)
#define repr(x, k, n)   for(int x = (k); x > (n); --x)
#define tr(it, a)       for(auto it = (a).begin(); it != (a).end(); ++it)
#define ll              long long
#define siz(x)          ((int)(x).size())
#define print(x)        cout << (x) << '\n'
#define prints(x)       cout << (x) << " "
#define eb              emplace_back
#define mp              make_pair
#define F               first
#define S               second
#define o2(x)           ( (x) * (x) )
#define all(x)          (x).begin(), (x).end()
#define allr(x)         (x).rbegin(), (x).rend()
#define clr(x, k)       memset(x, k, sizeof(x))
#define sortall(x)      sort(all(x))
#define sortalld(x)     sort(all(x), greater<int>())
#define printv(v)       rep(x, 0, siz(v)){ prints(v[x]); } cout << '\n'
#define print2dv(V)     rep(y, 0, siz(V)){ printv(V[y]); }
#define out(x)          cout << ((x) ? "Yes" : "No") << '\n';
#define inf             INT_MAX
#define ninf            INT_MIN
#define int             long long // take care of it when too much computation required

typedef pair<int, int>  pii;
typedef vector<int>     vi;
typedef vector<bool>    vb;
typedef vector<pii>     vpii;
typedef vector<vi>      vvi;
typedef vector<vb>      vvb;

template <typename Arg1>
void debug_out(const char* name, Arg1&& arg1){
    cout << name << " = " << arg1  << " ]" << '\n';
}
template <typename Arg1, typename... Args>
void debug_out(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " = " << arg1 <<",";
    debug_out(comma+1, args...);
}

#ifndef ONLINE_JUDGE
#define deb(...) cout << "[ ", debug_out(#__VA_ARGS__, __VA_ARGS__)
#else
#define deb(...)
#endif

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());

const int mod = 1e9+7; // 998244353
const int N = 3e5, M = N;

/*
-> Do not forget to check the edge cases.
-> Do something instead of nothing.
-> Make sure you are submitting the right file.
-> Do not make "easy->complicated", xd... :|.
*/
//-----------------------------------------------------------------------------

vi g[N];
int cost[N];
bool vis[N];

void dfs(int v, int &c){
    vis[v] = true;
    c = min(c, cost[v]);
    for(auto u : g[v]){
        if(!vis[u]){
            dfs(u, c);
        }
    }
}

void Solve_main() {
    int n, m;
    cin >> n >> m;
    rep(i, 0, n){
        cin >> cost[i];
    }
    int x, y;
    rep(i, 0, m){
        cin >> x >> y;
        x--; y--;
        g[x].eb(y);
        g[y].eb(x);
    }
    int res = 0;
    rep(i, 0, n){
        if(!vis[i]){
            int c = inf;
            dfs(i, c);
            res += c;
        }
    }
    cout << res << '\n';
}

//-----------------------------------------------------------------------------

int32_t main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    // cout << setprecision(10) << fixed;
    int tc = 1;
    // cin >> tc;
    for(int i = 0; i < tc; i++) {
        Solve_main();
    }

    cerr << "[time:" << 1.0*clock()/CLOCKS_PER_SEC << "s] ";
    return 0;
}