#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int c[200001];
int hash[200001];
bool traversed[200001];
int mx=-1,num=0;

int dfs(int n, vector<int> *g, int parent)
{
	//cout<<"At node: "<<n<<" Color: "<<c[n]<<endl;
	hash[c[n]]++;
	if(hash[ c[n] ]>mx) {
		mx=hash[ c[n] ];
	}
	int i;
	for(i=0;i<g[n].size();i++) {
		if(g[n][i]==parent) {
			continue;
		}
		if(!traversed[ g[n][i] ]) {
			num++;
			traversed[ g[n][i] ]=true;
			dfs( g[n][i], g, n );
		}
	}
	return 0;
}

int main()
{
	int n,m,k;
	cin>>n>>m>>k;
	//int c[n];
	int i;
	for(i=1;i<=n;i++) {
		cin>>c[i];
	}
	vector<int> g[n+1];
	//bool traversed[n+1];
	memset(traversed, false, sizeof(traversed));
	int l,r;
	for(i=0;i<m;i++) {
		cin>>l>>r;
		g[l].push_back(r);
		g[r].push_back(l);
	}
	int ans=0;
	for(i=1;i<=n;i++) {
		if(!traversed[i] && g[i].size()>0) {
			//memset(hash, 0, sizeof(hash));
			mx=-1;
			num=1;
			traversed[i]=true;
			dfs(i,g, -1);
			//cout<<num<<' '<<mx<<endl;
			ans+=(num-mx);
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int c[200001];
int hash[200001];
bool traversed[200001];
int mx=-1,num=0;

vector<int> g[200001];

map<int,int> sd;

int dfs(int n, int parent)
{
	//cout<<"At node: "<<n<<" Color: "<<c[n]<<endl;
	//hash[c[n]]++;
	sd[ c[n] ]++;
	if(sd[ c[n] ]>mx) {
		mx=sd[ c[n] ];
	}
	/*
	if(hash[ c[n] ]>mx) {
		mx=hash[ c[n] ];
	}
	*/
	int i;
	for(i=0;i<g[n].size();i++) {
		if(g[n][i]==parent) {
			continue;
		}
		if(!traversed[ g[n][i] ]) {
			num++;
			traversed[ g[n][i] ]=true;
			dfs( g[n][i], n );
		}
	}
	return 0;
}

int main()
{
	int n,m,k;
	//cin>>n>>m>>k;
	scanf("%d %d %d",&n,&m,&k);
	//int c[n];
	int i;
	for(i=1;i<=n;i++) {
		scanf("%d",c+i);
		//cin>>c[i];
	}
	//vector<int> g[n+1];
	//bool traversed[n+1];
	memset(traversed, false, sizeof(traversed));
	int l,r;
	for(i=0;i<m;i++) {
		scanf("%d %d",&l,&r);
		//cin>>l>>r;
		g[l].push_back(r);
		g[r].push_back(l);
	}
	int ans=0;
	for(i=1;i<=n;i++) {
		if(!traversed[i] && g[i].size()>0) {
			//memset(hash, 0, sizeof(hash));
			mx=-1;
			num=1;
			traversed[i]=true;
			dfs(i,-1);
			//cout<<num<<' '<<mx<<endl;
			ans+=(num-mx);
			sd.clear();
		}
	}
	printf("%d\n",ans);
	//cout<<ans<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int c[200001];
int hash[200001];
bool traversed[200001];
int mx=-1,num=0;

int dfs(int n, vector<int> *g, int parent)
{
	//cout<<"At node: "<<n<<" Color: "<<c[n]<<endl;
	hash[c[n]]++;
	if(hash[ c[n] ]>mx) {
		mx=hash[ c[n] ];
	}
	int i;
	for(i=0;i<g[n].size();i++) {
		if(g[n][i]==parent) {
			continue;
		}
		if(!traversed[ g[n][i] ]) {
			num++;
			traversed[ g[n][i] ]=true;
			dfs( g[n][i], g, n );
		}
	}
	return 0;
}

int main()
{
	int n,m,k;
	//cin>>n>>m>>k;
	scanf("%d %d %d",&n,&m,&k);
	//int c[n];
	int i;
	for(i=1;i<=n;i++) {
		scanf("%d",c+i);
		//cin>>c[i];
	}
	vector<int> g[n+1];
	//bool traversed[n+1];
	memset(traversed, false, sizeof(traversed));
	int l,r;
	for(i=0;i<m;i++) {
		scanf("%d %d",&l,&r);
		//cin>>l>>r;
		g[l].push_back(r);
		g[r].push_back(l);
	}
	int ans=0;
	for(i=1;i<=n;i++) {
		if(!traversed[i] && g[i].size()>0) {
			memset(hash, 0, sizeof(hash));
			mx=-1;
			num=1;
			traversed[i]=true;
			dfs(i,g, -1);
			cout<<num<<' '<<mx<<endl;
			ans+=(num-mx);
		}
	}
	printf("%d\n",ans);
	//cout<<ans<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int c[200001];
int hash[200001];
bool traversed[200001];
int mx=-1,num=0;

vector<int> g[200001];

int dfs(int n, int parent)
{
	//cout<<"At node: "<<n<<" Color: "<<c[n]<<endl;
	hash[c[n]]++;
	if(hash[ c[n] ]>mx) {
		mx=hash[ c[n] ];
	}
	int i;
	for(i=0;i<g[n].size();i++) {
		if(g[n][i]==parent) {
			continue;
		}
		if(!traversed[ g[n][i] ]) {
			num++;
			traversed[ g[n][i] ]=true;
			dfs( g[n][i], n );
		}
	}
	return 0;
}

int main()
{
	int n,m,k;
	//cin>>n>>m>>k;
	scanf("%d %d %d",&n,&m,&k);
	//int c[n];
	int i;
	for(i=1;i<=n;i++) {
		scanf("%d",c+i);
		//cin>>c[i];
	}
	//vector<int> g[n+1];
	//bool traversed[n+1];
	memset(traversed, false, sizeof(traversed));
	int l,r;
	for(i=0;i<m;i++) {
		scanf("%d %d",&l,&r);
		//cin>>l>>r;
		g[l].push_back(r);
		g[r].push_back(l);
	}
	int ans=0;
	for(i=1;i<=n;i++) {
		if(!traversed[i] && g[i].size()>0) {
			memset(hash, 0, sizeof(hash));
			mx=-1;
			num=1;
			traversed[i]=true;
			dfs(i,-1);
			//cout<<num<<' '<<mx<<endl;
			ans+=(num-mx);
		}
	}
	printf("%d\n",ans);
	//cout<<ans<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

int c[200001];
int hash[200001];
bool traversed[200001];
int mx=-1,num=0;

int dfs(int n, vector<int> *g)
{
	//cout<<"At node: "<<n<<" Color: "<<c[n]<<endl;
	hash[c[n]]++;
	if(hash[ c[n] ]>mx) {
		mx=hash[ c[n] ];
	}
	int i;
	for(i=0;i<g[n].size();i++) {
		if(!traversed[ g[n][i] ]) {
			num++;
			traversed[ g[n][i] ]=true;
			dfs( g[n][i], g );
		}
	}
	return 0;
}

int main()
{
	int n,m,k;
	cin>>n>>m>>k;
	//int c[n];
	int i;
	for(i=1;i<=n;i++) {
		cin>>c[i];
	}
	vector<int> g[n+1];
	//bool traversed[n+1];
	memset(traversed, false, sizeof(traversed));
	int l,r;
	for(i=0;i<m;i++) {
		cin>>l>>r;
		g[l].push_back(r);
		g[r].push_back(l);
	}
	int ans=0;
	for(i=1;i<=n;i++) {
		if(!traversed[i] && g[i].size()>0) {
			memset(hash, 0, sizeof(hash));
			mx=-1;
			num=1;
			traversed[i]=true;
			dfs(i,g);
			//cout<<num<<' '<<mx<<endl;
			ans+=(num-mx);
		}
	}
	cout<<ans<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iostream>

#define ll long long int
#define ull unsigned ll
#define SWAP(A,B) (A)=((A)+(B))-((B)=(A))

#define PI 3.14159265
//#define DEBUG(X) cout << (X) << endl;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUGL(x) std::cerr << "In " << __FILE__ << " at line " << __LINE__ << #x << ' = ' << x << std::endl;

// inputs
#define inpd(x) scanf("%d",&x)
#define inpc(x) scanf("%c",&x)

using namespace std;

int max(int a, int b)
{
	if(a>=b)
		return a;
	return b;
}

int max3(int a, int b, int c)
{
	return max(a,max(b,c));
}

int gcd(int a, int b)
{
	if(b==0)
		return a;
	return gcd(b,a%b);
}

typedef struct node {
	int l;
	int r;
}node;

int n,m,k;
//int c[200001];

int calc(int c[], int index, node qr[])
{
	if(index==m)
		return 0;
	int l,r,i;
	l=qr[index].l;
	r=qr[index].r;
	if(c[l-1]==c[r-1]) {
		return calc(c, index+1, qr);
	} else {
		int t[n];
		for(i=0;i<n;i++) {
			t[i]=c[i];
		}
		t[l-1]=t[r-1];
		int x=1+calc(t,index+1, qr);
		t[l-1]=c[l-1];
		t[r-1]=c[l-1];
		int y=1+calc(t,index+1, qr);
		return min(x,y);
	}
}

int main()
{
	//int n,m,k;
	cin>>n>>m>>k;
	int c[n];
	int hash[n+1];
	memset(hash, 0, sizeof(hash));
	int i;
	for(i=0;i<n;i++) {
		cin>>c[i];
	}
	node qr[m];
	int l,r;
	for(i=0;i<m;i++) {
		cin>>l>>r;
		qr[i].l=l;
		qr[i].r=r;
	}
	cout<<calc(c,0,qr)<<endl;
	return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;

int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ? x : uni[x]=get_boss(uni[x]);
}
void union_(int x,int y)
{
    int t1=get_boss(x);
    int t2=get_boss(y);
    if(t1!=t2)
    {
        uni[t1]=t2;
        sum[t2]+=sum[t1];
    }
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        union_(a,b);
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    if(n==200000)cout<<"all_boss="<<all_boss.size()<<endl;
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }
        ans+=(sum[*it]-cnt);
    }

    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;
/*
int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ? x : uni[x]=get_boss(uni[x]);
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        if(get_boss(a)!=get_boss(b))
        {
            uni[a]=uni[b];
            sum[b]+=sum[a];
        }
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }
        ans+=(sum[*it]-cnt);
    }
    cout<<ans<<endl;
    return 0;
}*/

//C.Scoks
int pre[MAX],c[MAX],sum[MAX];
set<int> boss;
vector<int>e[MAX];

int fin(int x){
    return x==pre[x]? x : pre[x]=fin(pre[x]);
}

void join(int x,int y)
{
    int t1=fin(x);
    int t2=fin(y);
    if(t1!=t2)
    {
        pre[t1]=t2;
        sum[t2]+=sum[t1];
    }
}

int main()
{
    int n,m,k;
    while(~scanf("%d%d%d",&n,&m,&k))
    {
        for(int i=1; i<=n; i++)
        {
            e[i].clear();
            pre[i]=i;
            sum[i]=1;
        }
        for(int i=1; i<=n; i++)
        {
            scanf("%d",&c[i]);
        }
        int u,v;
        for(int i=0; i<m; i++)
        {
            scanf("%d%d",&u,&v);
            join(u,v);
        }
        for(int i=1; i<=n; i++)
        {
            int fi=fin(i);
            e[fi].push_back(c[i]);
        }

        //
        for(int i=1;i<=n;i++){
            boss.insert(fin(i));
        }
        if(n==200000)cout<<"all_boss="<<boss.size()<<endl;

        int sum=0;
        for(int i=1; i<=n; i++)
        {
            if(e[i].size()!=0)
            {
                sort(e[i].begin(),e[i].end());
                int maxn=0,pp=1;
                for(int j=1; j<e[i].size(); j++)
                {
                    if(e[i][j]==e[i][j-1])
                    {
                        pp++;
                    }
                    else
                    {
                        maxn=max(pp,maxn);
                        pp=1;
                    }
                }
                maxn=max(pp,maxn);
                sum+=(e[i].size()-maxn);
            }
        }
        printf("%d\n",sum);
    }
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;

int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ?x : uni[x]=get_boss(uni[x]);
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        if(get_boss(a)!=get_boss(b))
        {
            uni[a]=uni[b];
            sum[b]+=sum[a];
        }
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    if(n==200000){
        cout<<all_boss.size()<<endl;
    }

    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();

        if(n==200000){
            cout<<s[*it].ma.size()<<endl;
        }
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }

        ans+=(sum[*it]-cnt);

        if(n==200000){
            cout<<sum[*it]<<" "<<cnt<<endl;
            cout<<"ans:"<<ans<<endl;
        }
    }

    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;
int uni[MAX],sum_same[MAX];

int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    memset(sum_same,0,sizeof(sum_same));
    for(int i=1;i<=n;i++){
        cin>>uni[i];
        sum_same[i]++;
    }
    int a,b,ans=0;
    while(m--){
        cin>>a>>b;
        if(uni[a]!=uni[b]){
            if(sum_same[b]<=sum_same[a]){
                uni[b]=uni[a];
                sum_same[a]+=sum_same[b];
                ans+=sum_same[b];
            }
            else {
                uni[a]=uni[b];
                sum_same[b]+=sum_same[a];
                ans+=sum_same[a];
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;

int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ? x : uni[x]=get_boss(uni[x]);
}
void union_(int x,int y)
{
    int t1=get_boss(x);
    int t2=get_boss(y);
    if(t1!=t2)
    {
        uni[t1]=t2;
        sum[t2]+=sum[t1];
    }
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        union_(a,b);
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }
        ans+=(sum[*it]-cnt);
    }

    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;

int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ?x : uni[x]=get_boss(uni[x]);
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        if(get_boss(a)!=get_boss(b))
        {
            uni[a]=uni[b];
            sum[b]+=sum[a];
        }
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }
        ans+=(sum[*it]-cnt);
    }
    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;

int color[MAX],uni[MAX],sum[MAX],n,m,k,a,b;
int get_boss(int x){
    return x==uni[x] ?x : uni[x]=get_boss(uni[x]);
}
struct same_color{
    map<int, int> ma;
}s[MAX];
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        cin>>color[i];
        uni[i]=i;
        sum[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a>>b;
        if(get_boss(a)!=get_boss(b))
        {
            uni[a]=uni[b];
            sum[b]+=sum[a];
        }
    }
    set<int> all_boss;
    for(int i=1;i<=n;i++){
        int boss=get_boss(i);
        all_boss.insert(boss);
        s[boss].ma[color[i]]++;
    }
    int ans=0;
    set<int>::iterator it=all_boss.begin();
    for(;it!=all_boss.end();it++){
        map<int,int>::iterator itt=s[*it].ma.begin();
        int cnt=0;
        for(;itt!=s[*it].ma.end();itt++){
            if(itt->second>cnt)
                cnt=itt->second;
        }
        ans+=(sum[*it]-cnt);
    }
    if(n==200000){
        cout<<"all:"<<all_boss.size()<<endl;
    }
    cout<<ans<<endl;
    return 0;
}


#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<sstream>
#include<cctype>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include <iterator>
#include <utility> //std::pair
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const double PI=acos(-1);
const double cha=10e-8;
const int MAX=2*1e5+5;
int uni[MAX],sum_same[MAX];

int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    memset(sum_same,0,sizeof(sum_same));
    for(int i=1;i<=n;i++){
        cin>>uni[i];
        sum_same[i]=1;
    }
    int a,b,ans=0;
    while(m--){
        cin>>a>>b;
        if(uni[a]!=uni[b]){
            if(sum_same[b]<=sum_same[a]){
                uni[b]=uni[a];
                sum_same[a]+=sum_same[b];
                ans+=sum_same[b];
            }
            else {
                uni[a]=uni[b];
                sum_same[b]+=sum_same[a];
                ans+=sum_same[a];
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k;
    cin >> n >> m >> k;
    int keep[n];
    int fen[n];
    for(int i = 0; i<n; i++)
    {
        int j;
        cin >> j;
        keep[i] = j-1;
        fen[i] = j-1;
    }
    int l[n],r[n],ant[n];
    for(int i = 0; i<m; i++)
    {
        int u;
        int v;
        cin >> u;
        cin >> v;
        l[i] = u-1;
        r[i] = v-1;
    }
    int cnt = 0;
    for(int i = 0; i<m; i++)
    {
      //  cout << fen[l[i]] << " " << fen[r[i]] << endl;
        if(fen[l[i]] != fen[r[i]])
        {

            fen[r[i]] = fen[l[i]];
            cnt++;
        }
    }
    cout << cnt << endl;
}


#include<bits/stdc++.h>
#define  mx 200005
using namespace std;
int fen[mx];
int l[mx],r[mx],ant[mx];
vector<int>graph[200005];
bool visited[200005];
int m;
int cnt;
void dfs(int u)
{
    if(visited[u])
    {
        return;
    }
    visited[u] = true;
    for(int i = 0; i<graph[u].size(); i++)
    {
        int v = graph[u][i];
        if(fen[u] != fen[v])
        {
            fen[v] = fen[u];
            cnt++;
        }
        dfs(v);
    }
      //  cout << fen[l[i]] << " " << fen[r[i]] << endl;

}

int main()
{
    int n,k;
    cin >> n >> m >> k;
    int keep[n];
    for(int i = 0; i<n; i++)
    {
        int j;
        cin >> j;
        keep[i] = j-1;
        fen[i] = j-1;
    }
    for(int i = 0; i<m; i++)
    {
        int u;
        int v;
        cin >> u;
        cin >> v;
        graph[u-1].push_back(v-1);
    }
    for(int i = 0; i<n; i++)
    {
        if(!visited[i])
        {
            dfs(i);
        }
    }

    cout << cnt << endl;
}


#include<bits/stdc++.h>

using namespace std;

int re[200005], le[200005];
int findparent(int n, int u)
{
    if(re[u] == n)
    {
        return n;
    }
    else if(re[u] == u)
    {
        return u;
    }
    findparent(re[u],n);
}

int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    int keep[n];
    for(int i = 0; i<n; i++)
    {
        int j;
        cin >> j;
        keep[i] = j-1;
    }
    int cnt = 0;
    int r[n], l[n];
    for(int i = 0; i<m; i++)
    {
        int u, v;
        cin >> u >> v;
        l[i] = keep[u-1];
        r[i] = keep[v-1];
        le[keep[u-1]] = keep[u-1];
        re[keep[v-1]] = keep[v-1];
    }
    for(int i = 0; i<m; i++)
    {
        if(re[r[i]] != le[l[i]])
        {
           int che = findparent(l[i], r[i]);
            if(le[l[i]] != che )
            {
                re[r[i]] = le[l[i]];
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k;
    cin >> n >> m >> k;
    int keep[n];
    for(int i = 0; i<n; i++)
    {
        int j;
        cin >> j;
        keep[i] = j-1;
    }
    int l[n],r[n],ant[n];
    for(int i = 0; i<m; i++)
    {
        int u;
        int v;
        cin >> u;
        cin >> v;
        l[i] = keep[u-1];
        r[i] = keep[v-1];
        ant[u-1] = u-1;
        ant[v-1] = v-1;
    }
    int cnt = 0;
    for(int i = 0; i<m; i++)
    {
        if(ant[l[i]] != ant[r[i]])
        {
            ant[r[i]] = ant[l[i]];
            cnt++;
        }
    }
    cout << cnt << endl;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k;
    cin >> n >> m >> k;
    int keep[n];
    int fen[n];
    for(int i = 0; i<n; i++)
    {
        int j;
        cin >> j;
        keep[i] = j-1;
        fen[i] = j-1;
    }
    int l[n],r[n],ant[n];
    for(int i = 0; i<m; i++)
    {
        int u;
        int v;
        cin >> u;
        cin >> v;
        l[i] = keep[u-1];
        r[i] = keep[v-1];
    }
    int cnt = 0;
    for(int i = 0; i<m; i++)
    {
        if(fen[l[i]] != fen[r[i]])
        {
            fen[r[i]] = fen[l[i]];
            cnt++;
        }
    }
    cout << cnt << endl;
}


#include<bits/stdc++.h>
#define  mxn 200005
using namespace std;
map<int, int>fen;
int keep[mxn];
int l[mxn],r[mxn],ant[mxn];
vector<int>graph[200005];
bool visited[200005];
int m;
int mx = -1;
int got = 0;
void dfs(int u)
{
    visited[u] = true;
    fen[keep[u]]++;
    //cout << fen[keep[u]] << endl;
    mx = max(mx, fen[keep[u]]);
    //cout << mx << endl;
    got++;
    for(int i = 0; i<graph[u].size(); i++)
    {
        int v = graph[u][i];
        if(!visited[v])
        {
            dfs(v);
        }
    }
      //  cout << fen[l[i]] << " " << fen[r[i]] << endl;
}

int main()
{
    int n,k;
    cin >> n >> m >> k;
    for(int i = 1; i<=n; i++)
    {
       cin >> keep[i];
    }
    for(int i = 0; i<m; i++)
    {
        int u;
        int v;
        cin >> u;
        cin >> v;
        graph[u].push_back(v);
        graph[v].push_back(u);
    }
    int cnt = 0;
    for(int i = 1; i<=n; i++)
    {
        if(!visited[i])
        {
            dfs(i);
            cnt = cnt + got-mx;
            //cout << got << mx << endl;
            fen.clear();
            mx = -1;
            got = 0;
        }

    }
    cout << cnt << endl;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int fa[200010];
int vv[200010];
vector<int>vec[200010];
int res=0;
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main()
{
    int n,m,k,i,j;
    cin>>n>>m>>k;
    for(i=1;i<=n;i++)
    {
        cin>>vv[i];
        fa[i]=i;
    }
    int x,y;
    for(i=1;i<=m;i++)
    {
        cin>>x>>y;
        int t1=find(x);
        int t2=find(y);
        if(t1!=t2)fa[t1]=t2;
    }
    for(i=1;i<=n;i++)
        vec[find(i)].push_back(vv[i]);
    map<int,int>mapp;
    int max_num=-1;
    int sum=0;
    int res=0;
    for(i=1;i<=n;i++)
    {
        if(vec[i].size()>1)
        {
            sum=0;
            for(j=0;j<vec[i].size();j++)
            {
                sum++;
                if(!mapp[vec[i][j]])mapp[vec[i][j]]=1;
                else mapp[vec[i][j]]++;
                max_num=max(max_num,mapp[vec[i][j]]);
                res+=sum-max_num;
            }
        }
    }
    cout<<res<<endl;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<map>
using namespace std;
int fa[200010];
int vv[200010];
vector<int>vec[200010];
int res=0;
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main()
{
    int n,m,k,i,j;
    scanf("%d%d%d",&n,&m,&k);
    for(i=1;i<=n;i++)
    {
        scanf("%d",&vv[i]);
        fa[i]=i;
    }
    int x,y;
    for(i=1;i<=m;i++)
    {
        scanf("%d%d",&x,&y);
        int t1=find(x);
        int t2=find(y);
        if(t1!=t2)fa[t1]=t2;
    }
    for(i=1;i<=n;i++)
        vec[find(i)].push_back(vv[i]);
    for(i=1;i<=n;i++)
    {
        if(vec[i].size()>1)
        {
            map<int,int>mapp;
            int sum=0;
            int max_num=-1;
            for(j=0;j<vec[i].size();j++)
            {
                sum++;
                if(!mapp[vec[i][j]])mapp[vec[i][j]]=1;
                else mapp[vec[i][j]]++;
                max_num=max(max_num,mapp[vec[i][j]]);
            }
            res+=sum-max_num;
            //cout<<sum<<' '<<max_num<<' '<<res<<endl;
        }
    }
   printf("%d\n",res);
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int fa[200010];
int vv[200010];
vector<int>vec[200010];
int res=0;
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main()
{
    int n,m,k,i,j;
    cin>>n>>m>>k;
    for(i=1;i<=n;i++)
    {
        cin>>vv[i];
        fa[i]=i;
    }
    int x,y;
    for(i=1;i<=m;i++)
    {
        cin>>x>>y;
        int t1=find(x);
        int t2=find(y);
        if(t1!=t2)fa[t1]=t2;
    }
    for(i=1;i<=n;i++)
        vec[find(i)].push_back(vv[i]);
    for(i=1;i<=n;i++)
    {
        if(vec[i].size()>1)
        {
            map<int,int>mapp;
            int sum=0;
            int max_num=-1;
            for(j=0;j<vec[i].size();j++)
            {
                sum++;
                if(!mapp[vec[i][j]])mapp[vec[i][j]]=1;
                else mapp[vec[i][j]]++;
                max_num=max(max_num,mapp[vec[i][j]]);
            }
            res+=sum-max_num;
            //cout<<sum<<' '<<max_num<<' '<<res<<endl;
        }
    }
    cout<<res<<endl;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int fa[200010];
int vv[200010];
vector<int>vec[200010];
int res=0;
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main()
{
    int n,m,k,i,j;
    cin>>n>>m>>k;
    for(i=1;i<=n;i++)
    {
        cin>>vv[i];
        fa[i]=i;
    }
    int x,y;
    for(i=1;i<=m;i++)
    {
        cin>>x>>y;
        int t1=find(x);
        int t2=find(y);
        if(t1!=t2)fa[t1]=t2;
    }
    for(i=1;i<=n;i++)
        vec[find(i)].push_back(vv[i]);
    map<int,int>mapp;
    int max_num=-1;
    int sum=0;
    for(i=1;i<=n;i++)
    {
        if(vec[i].size()>1)
        {
            for(j=0;j<vec[i].size();j++)
            {
                sum++;
                if(!mapp[vec[i][j]])mapp[vec[i][j]]=1;
                else mapp[vec[i][j]]++;
                max_num=max(max_num,mapp[vec[i][j]]);
            }
        }
    }
    cout<<sum-max_num<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pii;

const int N = 2e5 + 10;
const int M = 1e9;
int n, x, m, tmp, ans, k, t;
int a[N], b[N], h[N];
string s, p;
map<int, bool> mark;
vector<int> nei[N];

void read_input() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = a[i] - (n - i);
	}
	sort(b, b + n);
	for (int i = 0; i < n; i++) {
		if (!mark[b[i]])
			mark[b[i]] = true;
		else {
			cout << ":(";
			return;
		}
	}
	for (int i = 0; i < n; i++) {
		cout << b[i] + (n - i) << ' ';
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	read_input();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pii;

const int N = 2e5 + 10;
const int M = 1e9;
int n, x, m, tmp, ans, k, t;
int a[N], b[N], h[N];
string s, p;
map<string, int> pol;
vector<int> nei[N];
bool mark[M];

void read_input() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = a[i] - (n - i);
	}
	sort(b, b + n);
	for (int i = 0; i < n; i++) {
		if (!mark[b[i]])
			mark[b[i]] = true;
		else {
			cout << ":(";
			return;
		}
	}
	for (int i = 0; i < n; i++) {
		cout << b[i] + (n - i) << ' ';
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	read_input();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pii;

const int N = 2e5 + 10;
int n, x, m, tmp, ans, k, t;
int a[N], b[N], h[N];
string s, p;
map<string, int> pol;
vector<int> nei[N];
bool mark[N];

void read_input() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = a[i] - (n - i);
	}
	sort(b, b + n);
	for (int i = 0; i < n; i++) {
		if (!mark[b[i]])
			mark[b[i]] = true;
		else {
			cout << ":(";
			return;
		}
	}
	for (int i = 0; i < n; i++) {
		cout << b[i] + (n - i) << ' ';
	}
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	read_input();

	return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll a[200005] , b[200005];
typedef pair<ll,ll> pll;
priority_queue<pll> pq;
int main() {

    ll n;
    cin >> n;
    for(ll i=1;i<=n;i++) cin >> a[i];
    reverse(a+1 , a+n+1);
    for(ll i=1;i<=n;i++) {
        //cin >> a[i];

        a[i] -= i-1;
        //cout << i << " " << a[i] << endl;
        pq.push(make_pair(a[i] , i));
    }
    for(ll pos=1;pos<=n;pos++) {
        ll id = pq.top().second;
        ll num = pq.top().first;
        pq.pop();
        num += id-1;
        b[pos] = num - (id - pos);
        if(b[pos] < 0){
            cout << ":(\n"; return 0;
        }
    }
    for(ll i=2;i<=n;i++) {
        if(b[i] > b[i-1]) {
            cout << ":(\n"; return 0;
        }
    }
    reverse(b+1,b+n+1);
    for(ll i=1;i<=n;i++) cout << b[i] << " ";
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
const int N = 200005;
struct ban
{
    int i, x;
};
bool operator<(const ban& a, const ban& b)
{
    return a.x < b.x;
}

int n;
ban a[N];

int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
    {
        a[i].i = i;
        scanf("%d", &a[i].x);
    }
    for (int i = 1; i <= n; ++i)
        a[i].x += i;
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; ++i)
    {
        if (a[i].x == a[i - 1].x)
        {
            printf(":(\n");
            return 0;
        }
    }
    for (int i = 1; i <= n; ++i)
    {
        printf("%d ", a[i].x - i);
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n;
ll a[200005];
int main()
{
        cin >> n;
        for(ll i=1;i<=n;i++) cin >> a[i];
        for(ll i=1;i<n;i++)
        {
                if(a[i+1] < a[i])
                {
                        if(a[i] - a[i+1] == 1)
                        {
                                cout << ":(\n"; return 0;
                        }
                        swap(a[i],a[i+1]);
                        a[i]++;
                        a[i+1]--;
                }
        }
        for(ll i=1;i<=n;i++) cout << a[i] << " ";
        return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n;
ll a[200005];
int main()
{
        cin >> n;
        for(ll i=1;i<=n;i++)
        {
                cin >> a[i];
                a[i] -= n - i + 1;
        }
        sort(a + 1, a + n + 1);
        for(ll i=1;i<=n;i++)
        {
                a[i] += n - i + 1;
        }
        for(ll i=1;i<n;i++)
        {
                if(a[i] < 0)
                {
                        cout << ":(\n"; return 0;
                }
                if(a[i] > a[i+1])
                {
                        cout << ":(\n";
                        return 0;
                }
        }
        if(a[n] < 0){
                cout << ":(\n"; return 0;
        }
        for(ll i=1;i<=n;i++) cout << a[i] << " ";
        return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define F first
#define FF first.first
#define FS first.second
#define S second
#define pb push_back
#define PI 3.14159265
using namespace std;
const int N=1000006;

ll n, m, q=1, a[N], b[N], f[N], t, z, x, y, k, u, h, mx, mn, Ans;
pair<ll,ll> p[N];
string s[N];
vector<int> v;

main(){

	cin>>n;
	for (int i=1; i<=n; i++){
		cin>>p[i].S;
		p[i].F=p[i].S+i;
	}
	sort(p+1, p+n+1);
	for (int i=2; i<=n; i++){
		if(p[i].F-i<p[i-1].F-i+1){
			cout<<":(";
			return 0;
		}
	}
	for (int i=1; i<=n; i++){
		cout<<p[i].F-i<<" ";
	}
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> A(N);
	int res = 0;
	set<int> st;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		st.insert(A[i] + i);
	}
	if ((int)st.size() != N) {
		cout << ":(" << endl;
	}
	else {
		int i = 0;
		for (auto s : st) {
			if (i > 0)cout << " ";
			cout << s - i;
			i++;
		}
		cout << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL n,a[200010];
int main()
{
	cin>>n;
	LL i,j;
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
		a[i]-=(n-i);
	}
	sort(a,a+n);
	for(i=1;i<n;i++)
		if(a[i]==a[i-1])
		{
			cout<<":("<<endl;
			return 0;
		}
	for(i=0;i<n;i++)	printf("%lld ",a[i]+(n-i));
	return 0;
}


#include <bits/stdc++.h>

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)

#define lli long long
#define vi vector<int>
#define vlli vector<lli>
#define pi pair<int,int>
#define vpi vector<pi>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int n;

    cin >> n;

    lli arr[n+1];

    for(int i = 1; i <= n; i++) {
        cin >> arr[i];
        arr[i] +=i;
    }

    sort(arr+1, arr + n+1);

    bool ok = true;

    for(int i = 1; i < n; i++) {
        if(arr[i] >= arr[i+1]) ok = false;
    }

    if(ok)
        for(int i = 1; i <= n; i++)
            cout << arr[i] - i << " ";
    else
        cout << ":(";
    cout << endl;
}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <deque>
using namespace std;

const int maxN = 2e5 + 5;
const int INF = 1e9;
const int MOD = 1e9 + 7;

bool flag = true;
int n, i;
int money[maxN], tmp[maxN];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	for (i = 0; i < n; i++){
		cin >> money[i];
		money[i] += i;
	}
	sort(money, money + n);
	for (i = 0; i < n; i++){
		money[i]-= i;
		tmp[i] = money[i];
	}
	sort(tmp, tmp + n);
	for (i = 0; i < n; i++){
		flag &= (tmp[i] == money[i]);
	}
	if (flag){
		for (i = 0; i < n; i++){
			cout << money[i] << " ";
		}
		cout << endl;
	}
	else{
		cout << ":(\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)(1e9 + 5))
#define MAXL ((ll)(1e18 + 5))
#define MAX_X ((int)(1e6 + 2))
#define pi (2.0*acos(0))
#define M ((int)(1e9 + 7))
#define NN ((ll)(305))
#define N ((int)(2e5 + 5))
#define eps (0)
//#define log 29

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/

typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

int arr[N], ans[N];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
    while(t--)
    {
        int n;
        cin>>n;
        priority_queue < pair < int, int > > q;
        for(int i = n; i>0; i--)
        {
            cin>>arr[i];;
            q.push({arr[i] - i,i});
        }
        bool flag = 0;
        for(int i = 1; i<=n; i++)
        {
            pair < int, int > p = q.top();
            q.pop();
            if(!q.empty())
            {
                if(p.first==q.top().first)
                {
                    cout<<":(\n";
                    flag = 1;
                    break;
                }
            }
            ans[i] = arr[p.second]+(i-p.second);
        }

        if(flag) continue;

        for(int i = n; i>0; i--)
            cout<<ans[i]<<" ";
        cout<<"\n";
    }
    return 0;
}


//  In The Name Of God
// TTLDOMLIWPTTE
#include <bits/stdc++.h>

#define SET(A, X) (A | (1 << X))
#define OFF(A, X) (A & ~(1 << X))
#define GET(A, X) ((A & (1 << X)) && 1)
#define FFS(A) (A & (-A))
#define sqr(A) ((A) * (A))
using namespace std;
typedef long long ll;
typedef long double ld;
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;

const int N = 2e5;
pair<int, int> a[N];
int n;

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i].second;
		a[i].first = a[i].second + i;
	}
	sort(a, a + n);
	for (int i = 1; i < n; i++)
		if (a[i].first == a[i - 1].first)
			return cout << ":(" << endl, 0;
	for (int i = 0; i < n; i++)
		cout << a[i].second - i + a[i].first - a[i].second << ' ';
	cout << endl;
}


#include<bits/stdc++.h>
const int MAXN=2e5+10;
using namespace std;
long long a[MAXN],b[MAXN];
int main()
{
	ios::sync_with_stdio(0); cin.tie(); cout.tie();
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
       	{
	       	cin>>a[i];
		b[i]=a[i]+i;
	}
	sort(b+1,b+n+1);
	for(int i=1;i<n;i++)
		if(b[i]==b[i+1])
			return cout<<":(",0;
	for(int i=1;i<=n;i++)
		cout<<b[i]-i<<" ";

}


#include<bits/stdc++.h>
const int MAXN=2e5+10;
using namespace std;
int a[MAXN],b[MAXN];
bool mark[MAXN];
int main()
{
	ios::sync_with_stdio(0); cin.tie(); cout.tie();
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
       	{
	       	cin>>a[i];
		b[i]=a[i]+i;
		if(mark[b[i]]==0)
			mark[b[i]]=1;
		else
			return cout<<":(",0;
	}
	sort(b+1,b+n+1);
	for(int i=1;i<=n;i++)
		cout<<b[i]-i<<" ";

}


#include<bits/stdc++.h>
const int MAXN=2e5+10;
using namespace std;
long long a[MAXN],b[MAXN];
int main()
{
	ios::sync_with_stdio(0); cin.tie(); cout.tie();
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
       	{
	       	cin>>a[i];
		b[i]=a[i]+i;
	}
	sort(b+1,b+n+1);
	for(int i=1;i<n;i++)
		if(b[i]=b[i+1])
			return cout<<":(",0;
	for(int i=1;i<=n;i++)
		cout<<b[i]-i<<" ";

}


//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define pll pair<ll, ll>
const ll N = 2e5 + 5;

int n;
pll a[N];

bool cmp(pll x, pll y){
	return (x.F + x.S) < (y.F + y.S);
}
int main(){
	fast_io
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i].F;
		a[i].S = i;
	}
	sort(a, a + n, cmp);
	for(int i = 0; i < n - 1; i++)
		if((a[i].F + a[i].S - i) > (a[i + 1].F + a[i + 1].S - i - 1)){
			cout << ":(" << endl;
			return 0;
		}
	for(int i = 0; i < n; i++)
		cout << a[i].F + a[i].S - i << " ";
	cout << endl;
	return 0;
}


//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define F first
#define S second
#define endl '\n'
typedef long long ll;
const int N = 2e5 + 5;

int n;
int a[N];

int main(){
	fast_io;
	cin >> n;
	for(int i = 0; i < n; i++)cin >> a[i];
	for(int i = n - 2; i >= 0; i--){
		int j = i;
		while(j < n - 1&& a[j] > a[j + 1]){
			a[j] --;
			a[j + 1] ++;
			swap(a[j], a[j + 1]);
			j++;
		}
	}
	for(int i = 0; i < n - 1; i++){
		if(a[i] > a[i + 1]){
			cout << ":(" << endl;
			return 0;
		}
	}
	for(int i = 0; i < n; i++)cout << a[i] << " ";
	return 0;
}


//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define F first
#define S second
#define endl '\n'
typedef long long ll;
const int N = 2e5 + 5;

int n;
int a[N];

int main(){
	cin >> n;
	for(int i = 0; i < n; i++)cin >> a[i];
	for(int i = n - 2; i >= 0; i--){
		int j = i;
		while(j < n - 1&& a[j] > a[j + 1]){
			a[j] --;
			a[j + 1] ++;
			swap(a[j], a[j + 1]);
			j++;
		}
	}
	for(int i = 0; i < n - 1; i++){
		if(a[i] > a[i + 1]){
			cout << ":(" << endl;
			return 0;
		}
	}
	for(int i = 0; i < n; i++)cout << a[i] << " ";
	return 0;
}


//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define F first
#define S second
#define endl '\n'
typedef long long ll;
const int N = 2e5 + 5;

int n;
int a[N];

int main(){
	fast_io
	cin >> n;
	for(int i = 0; i < n; i++)cin >> a[i];
	for(int i = n - 2; i >= 0; i--){
		int j = i;
		while(j < n - 1&& a[j] > a[j + 1]){
			a[j] --;
			a[j + 1] ++;
			swap(a[j], a[j + 1]);
			j++;
		}
	}
	for(int i = 0; i < n - 1; i++){
		if(a[i] > a[i + 1]){
			cout << ":(" << endl;
			return 0;
		}
	}
	for(int i = 0; i < n; i++)cout << a[i] << " ";
	return 0;
}


//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define pll pair<ll, ll>
const ll N = 2e5 + 5;

int n;
pll a[N];

bool cmp(pll x, pll y){
	return (x.F + x.S) < (y.F + y.S);
}
int main(){
	fast_io
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i].F;
		a[i].S = i;
	}
	sort(a, a + n, cmp);
	for(int i = 0; i < n - 1; i++)
		if(a[i] > a[i + 1]){
			cout << ":(" << endl;
			return 0;
		}
	for(int i = 0; i < n; i++)
		cout << a[i].F + a[i].S - i << " ";
	cout << endl;
	return 0;
}


#include<iostream>
#include<algorithm>

using namespace std;

int main(){
	int n,flg=0;
	cin>>n;
	int *l=new int[n];
	for(int i=0;i<n;i++){
		cin>>l[i];
		l[i]+=i;
	}
	sort(l,l+n);
	for(int i=0;i<n;i++){
		l[i]-=i;
		if(i-1>=0 && l[i-1]>l[i]){
			flg=1;
			break;
		}
	}
	if(flg==1){
		cout<<":("<<endl;
	}
	else{
		for(int i=0;i<n;i++){
			cout<<l[i]<<endl;
		}
	}

	delete[] l;

	return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>

int main(){

    long n; scanf("%ld", &n);
    std::vector<long> a(n);
    for(long p = 0; p < n; p++){scanf("%ld", &a[p]); a[p] += p;}
    sort(a.begin(), a.end());
    for(long p = 1; p < n; p++){if(a[p - 1] == a[p]){puts(":("); return 0;}}
    for(long p = 0; p < n; p++){printf("%ld ", a[p] - p);}
    puts("");

    return 0;
}


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

const int N = 4e5 + 10;
int n, a[N];
vector<int> v;

bool cmp(int i, int j){
	return (i + a[i] < j + a[j]);
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
		v.push_back(i);
	}
	sort(v.begin(), v.end(), cmp);
	for (int i = 1; i < n; i++)
		if(v[i] + a[v[i]] == v[i - 1] + a[v[i - 1]])
			return cout << ":(", 0;

	for (int i = 0; i < n; i++)
		cout << a[v[i]] + v[i] - i << ' ';
	return 0;
}


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

const int N = 1e5 + 10;
int n, a[N];
vector<int> v;

bool cmp(int i, int j){
	return (i + a[i] < j + a[j]);
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
		v.push_back(i);
	}
	sort(v.begin(), v.end(), cmp);
	for (int i = 1; i < n; i++)
		if(v[i] + a[v[i]] == v[i - 1] + a[v[i - 1]])
			return cout << ":(", 0;

	for (int i = 0; i < n; i++){
		if(i > v[i])
			cout << a[v[i]] - (i - v[i]) << ' ';
		else
			cout << a[v[i]] + (v[i] - i) << ' ';
	}
}


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

const int N = 4e5 + 10;
int n, a[N];
vector<int> v;

bool cmp(int i, int j){
	return (i + a[i] < j + a[j]);
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
		v.push_back(i);
	}
	sort(v.begin(), v.end(), cmp);
	for (int i = 1; i < n; i++)
		if(v[i] + a[v[i]] == v[i - 1] + a[v[i - 1]])
			return cout << ":(", 0;

	for (int i = 0; i < n; i++){
		if(i > v[i])
			cout << a[v[i]] - (i - v[i]) << ' ';
		else
			cout << a[v[i]] + (v[i] - i) << ' ';
	}
	return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
#define xx first
#define yy second
const int nax = 1e5 + 5;
pii A[nax];
int res[nax];

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int x; scanf("%d", &x);
        A[i] = {x, i};
    }
    sort(A, A+n, [](const pii& a, const pii& b) {
        return a.xx + a.yy < b.xx + b.yy;
    });
    for (int i = 0; i < n; i++)
        res[i] = A[i].xx + A[i].yy - i;
    for (int i = 1; i < n; i++)
        if (res[i] < res[i-1])
            return printf(":(\n"), 0;
    for (int i = 0; i < n; i++)
        printf("%d ", res[i]);
    printf("\n");
    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
#define xx first
#define yy second
const int nax = 2e5 + 5;
pii A[nax];
int res[nax];

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int x; scanf("%d", &x);
        A[i] = {x, i};
    }
    sort(A, A+n, [](const pii& a, const pii& b) {
        return a.xx + a.yy < b.xx + b.yy;
    });
    for (int i = 0; i < n; i++)
        res[i] = A[i].xx + A[i].yy - i;
    for (int i = 1; i < n; i++)
        if (res[i] < res[i-1])
            return printf(":(\n"), 0;
    for (int i = 0; i < n; i++)
        printf("%d ", res[i]);
    printf("\n");
    return 0;
}


#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
#include<random>
using namespace std;

#define MAX 200002

int n;

long long int a[MAX];

#define NG ":("

vector<pair<long long int,int> > val;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		scanf("%lld", &a[i]);
	}
	reverse(a, a + n);
	for (int i = 0; i < n;i++){
		a[i] += n - i;
		val.push_back(make_pair(-a[i],i) );
	}
	sort(a, a + n);
	reverse(a, a + n);
	vector<int> ans;
	for (int i = 0; i < n; i++){
		ans.push_back(a[i] - (n - i));
		if (i){
			if (ans[i - 1] > ans[i]){
				puts(NG);
				return 0;
			}
		}
	}
	reverse(ans.begin(), ans.end());
	for (int i = 0; i < n; i++){
		if (i){
			printf(" ");
		}
		printf("%d", ans[i]);
	}
	puts("");
	return 0;
}


#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
#include<random>
using namespace std;

#define MAX 200002

int n;

long long int a[MAX];

#define NG ":("

vector<pair<long long int,int> > val;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		scanf("%lld", &a[i]);
	}
	reverse(a, a + n);
	for (int i = 0; i < n;i++){
		a[i] += n - i;
		val.push_back(make_pair(-a[i],i) );
	}
	sort(a, a + n);
	reverse(a, a + n);
	vector<int> ans;
	for (int i = 0; i < n; i++){
		ans.push_back(a[i] - (n - i));
		if (i){
			if (ans[i - 1] < ans[i]){
				puts(NG);
				return 0;
			}
		}
	}
	reverse(ans.begin(), ans.end());
	for (int i = 0; i < n; i++){
		if (i){
			printf(" ");
		}
		printf("%d", ans[i]);
	}
	puts("");
	return 0;
}


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

int main(void)
{
	int n;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	int d[n];
	for (int i = 0; i < n; ++i)
	{
		d[i] = a[i] - (n-1-i);
	}
	sort(d, d+n);
	int curmin = d[n-1];
	int ans[n] = {0}, add = 0;
	for (int i = n-1; i >= 0; --i)
	{
		ans[i] = d[i] + add;
		if (ans[i] > curmin)
		{
			cout << ":(" << '\n';
			return 0;
		}
		++add;
		curmin = min(curmin, ans[i]);
	}
	for (int i = 0; i < n; ++i)
	{
		cout << ans[i] << ' ';
	}
}


#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for (int i=(a); i<=(b); i++)
#define FOD(i, a, b) for (int i=(a); i>=(b); i--)
#define fi first
#define se second
#define sqr(x) (x)*(x)
#define sze(x) (int) x.size()

using namespace std;
typedef pair<int, int> pi;
const int N = 2e5 + 5;

int a[N];
int n;

int32_t main()
{
    fastio
    cin >> n;
    FOR(i,1,n)
    {
        cin >> a[i];
        a[i] += i - 1;
    }
    sort(a+1,a+n+1);
    FOR(i,1,n)
    {
        a[i] -= i - 1;
    }
    FOR(i,2,n) if (a[i]<a[i-1]) return cout << ":(", 0;
    FOR(i,1,n) cout << a[i] << " ";
    return 0;
}


#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for (int i=(a); i<=(b); i++)
#define FOD(i, a, b) for (int i=(a); i>=(b); i--)
#define fi first
#define se second
#define sqr(x) (x)*(x)
#define sze(x) (int) x.size()

using namespace std;
typedef pair<int, int> pi;
const int N = 1e5 + 5;

int a[N];
int n;

int32_t main()
{
    fastio
    cin >> n;
    FOR(i,1,n) cin >> a[i];
    int mx = 0;
    FOR(i,2,n) mx = max(mx, a[i]);
    if (a[1] - n + 1>mx)
    {
        sort(a+1,a+n+1);
        FOR(i,1,n)
        {
            if (i==n) cout << a[i] - n + 1;
            else cout << a[i] + 1 << " ";
        }
    }
    else cout << ":(";
    return 0;
}


#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for (int i=(a); i<=(b); i++)
#define FOD(i, a, b) for (int i=(a); i>=(b); i--)
#define fi first
#define se second
#define sqr(x) (x)*(x)
#define sze(x) (int) x.size()

using namespace std;
typedef pair<int, int> pi;
const int N = 1e5 + 5;

int a[N];
int n;

int32_t main()
{
    fastio
    cin >> n;
    FOR(i,1,n)
    {
        cin >> a[i];
        a[i] += i - 1;
    }
    sort(a+1,a+n+1);
    FOR(i,1,n)
    {
        a[i] -= i - 1;
    }
    FOR(i,2,n) if (a[i]<a[i-1]) return cout << ":(", 0;
    FOR(i,1,n) cout << a[i] << " ";
    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<cstdio>
#include<math.h>
#include<cstdlib>
#include<map>
#include<unordered_map>
#include<utility>
#include<stack>
#include<fstream>
#include<set>
#include<queue>
#include<iomanip>

using namespace std;

#define ll long long int
#define ld long double

const ll inf = 1e+15;
const ll mod = 1e9+7;

#define cincout ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define me(a,i) memset(a,i,sizeof(a))
#define mp make_pair
#define VLL vector <ll>
#define PLL pair <ll,ll>
#define VLD vector <ld>
#define pb push_back
#define sortv(v) sort(v.begin(),v.end())
#define sortvd(v) sort(v.begin(),v.end(),greater<int>())
#define printv(n,v) for(int i=0;i<n;i++)  {cout<<v[i]<<" ";}
#define vin(v,n,a) for(int i=0;i<n;i++)	{v.pb(a);cin>>v[i];}
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FF(i,a,b) for (int i = (a); i < (b); i++)
#define FD(i,a,b) for (int i = (a); i >= (b); i--)

ll n,x;
vector<ll> nums;

int main(){
	cincout;
	cin>>n;
	FF(i,0,n){
		cin>>x;
		nums.pb(x-n+i);
	}
	sortv(nums);
	FF(i,1,n){
		if(nums[i-1]>=nums[i]){
			cout<<":("<<endl;
			return 0;
		}
	}
	FF(i,0,n)
		cout<<nums[i]+n-i<<" ";
	cout<<endl;
  	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<cstdio>
#include<math.h>
#include<cstdlib>
#include<map>
#include<unordered_map>
#include<utility>
#include<stack>
#include<fstream>
#include<set>
#include<queue>
#include<iomanip>

using namespace std;

#define ll long long int
#define ld long double

const ll inf = 1e+15;
const ll mod = 1e9+7;

#define cincout ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define me(a,i) memset(a,i,sizeof(a))
#define mp make_pair
#define VLL vector <ll>
#define PLL pair <ll,ll>
#define VLD vector <ld>
#define pb push_back
#define sortv(v) sort(v.begin(),v.end())
#define sortvd(v) sort(v.begin(),v.end(),greater<int>())
#define printv(n,v) for(int i=0;i<n;i++)  {cout<<v[i]<<" ";}
#define vin(v,n,a) for(int i=0;i<n;i++)	{v.pb(a);cin>>v[i];}
#define FIT(it,v) for (typeof(v.begin()) it = v.begin(); it != v.end(); it++)
#define FF(i,a,b) for (int i = (a); i < (b); i++)
#define FD(i,a,b) for (int i = (a); i >= (b); i--)

ll n,x;
vector<ll> nums;

int main(){
	cincout;
	cin>>n;
	FF(i,0,n){
		cin>>x;
		nums.pb(x-n+i);
		cout<<nums[i]<<" ";
	}
	cout<<endl;
	sortv(nums);
	FF(i,1,n){
		if(nums[i-1]>=nums[i]){
			cout<<":("<<endl;
			return 0;
		}
	}
	FF(i,0,n)
		cout<<nums[i]+n-i<<" ";
	cout<<endl;
  	return 0;
}


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

const int N = 2e5 + 5;
int a[N];

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

	sort(a + 1, a + 1 + n);

	int ok = 1;
	for(int i = 1; i < n; i++)
	{
		if(a[i] == a[i + 1])ok = 0;
	}
	if(!ok)
	{
		puts(":(");
		return 0;
	}
	else
	{
		for(int i = 1; i <= n; i++)cout << a[i] - i << " " ;
	}
}


#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int,int>& a,const pair<int,int>& b) {
    // compare with diff
    int diff = b.second-a.second;
    int A = a.first;
    int B = b.first+diff;
    return A<B;
}
int main() {
    int n;
    scanf("%d",&n);
    vector<pair<int,int> > V;
    for(int i = 0;i < n;i++) {
        int x;
        scanf("%d",&x);
        V.push_back(pair<int,int>(x,i));
    }
    // sort !
    stable_sort(V.begin(),V.end(),cmp);
    vector<int> ans;
    for(int i = 0;i < n;i++) {
        // see if this one can go here
        //printf("%d : (%d,%d)\n",i,V[i].first,V[i].second);
        ans.push_back((V[i].second-i)+V[i].first);
    }
    /*for(int i = 0;i < n;i++) {
        printf("%d ",ans[i]);
    }
    printf("\n");*/
    for(int i = 0;i < n-1;i++) {
        if(ans[i] > ans[i+1]) {
            printf(":(");
            return 0;
        }
    }
    for(int i = 0;i < n;i++) {
        printf("%d ",ans[i]);
    }

}


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

int main() {
    int n;
    scanf("%d",&n);
    vector<pair<int,int> > V;
    for(int i = 0;i < n;i++) {
        int x;
        scanf("%d",&x);
        V.push_back(pair<int,int>(x,i));
    }
    // sort !
    sort(V.begin(),V.end());
    vector<int> ans;
    for(int i = 0;i < n;i++) {
        // see if this one can go here
        ans.push_back((V[i].second-i)+V[i].first);
    }
    for(int i = 0;i < n-1;i++) {
        if(ans[i] > ans[i+1]) {
            printf(":(");
            return 0;
        }
    }
    for(int i = 0;i < n;i++) {
        printf("%d ",ans[i]);
    }

}


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

const int N = 2e5 + 10;
vector<int> v, ans;
int n, x;
bool tmp;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x;
		v.push_back(x + i);
	}
	sort(v.begin(), v.end());
	for (int i = 1; i < n; i++) {
		if (v[i] == v[i - 1]) {
			tmp = true;
		}
	}
	if (tmp) {
		cout << ":(";
		return 0;
	}
	else {
		for (int i = 0; i < v.size(); i++)
			cout << v[i] - i << " ";
	}
}


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

vector<int> v;
int n, x;
bool tmp;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> x, v.push_back(x + i);
	sort(v.begin(), v.end());
	for (int i = 1; i < n; i++)
		if (v[i] == v[i - 1])
			tmp = true;
	if (tmp)
		cout << ":(";
	else {
		for (int i = 0; i < v.size(); i++)
			cout << v[i] - i << " ";
	}
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define ff first
#define ss second
#define pb push_back
#define ll long long
#define N 200005
using namespace std;

struct Res{
    int id, mon;
    bool operator<(const Res& rhs) const {
        if(mon + id == rhs.mon + rhs.id){
            cout<<":(";
            exit(0);
        }
        return mon + id < rhs.mon + rhs.id;
    }
};

vector<Res> q;
long long ans[N];

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin>>n;
    q.resize(n);
    for(int i = 0; i < n; i++){
        cin>>q[i].mon;
        q[i].id = i;
    }
    sort(q.begin(), q.end());

    for(int i = 0; i < n; i++){
        cout<<q[i].mon + q[i].id - i<<' ';
    }

}


/* Sometimes , You Just
Have To Bow Your Head , Say
A Prayer & Weather The Storm :) */
//RTn_E
#include <bits/stdc++.h>
#define __Sync ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0) ;
#define __file freopen("input.txt", "r", stdin) ; freopen("output.txt", "w", stdout) ;
#define ll long long
#define pb push_back
#define ld long double
#define F first
#define S second
#define mk make_pair

using namespace std;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e12;

//Main CODE :/\

ll a[maxn];
int main() {
    __Sync;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i] , a[i] += i;
    sort(a , a + n);
    for (int i = 0; i < n - 1; i++){
        if (a[i] == a[i + 1])
            return cout << ":(" << endl , 0;
    }
    for (int i = 0; i < n; i++)
        cout << a[i] - i << " ";
    cout << endl;
    return 0;
}
//The_End
//Game Over :D


#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define fi first
#define se second
#define reset(n,k) memset((n),k,sizeof(n))
#define all(n) n.begin(),n.end()
#define pb push_back
using namespace std;
using ll=long long;
using pii=pair<int,int>;
ll arr[200005];
ll ans[200005];
int main(){
	IOS;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
		arr[i] += i;
	}
	int mi = 0;
	sort(arr,arr+n);
	for(int i=0;i<n;i++){
		ans[i] = arr[i] - mi;
		if(i && ans[i] < ans[i-1]){
			cout<<":(\n";
			return 0;
		}
		mi++;
	}
	for(int i=0;i<n;i++){
		cout<<ans[i]<<" \n"[i==n-1];
	}

}


#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define openfile freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define f(i, x, y) for(int i = x; i < y; i++)
#define all(X) X.begin(), X.end()
#define int long long
#define key pair<int, int>
#define ff first
#define ss second
int mod = 1e9 + 7;
const int inf = 2e18;
using namespace std;

int fen[200001], b[200001];

void update(int pos)
{
    if(!pos) return ;
    for(; pos <= 200000; pos += pos&-pos)
        fen[pos]++;
}

int sum(int pos)
{
    int s = 0;
    for(; pos > 0; pos -= pos&-pos)
        s += fen[pos];
    return s;
}

class cmp{
    public:
    bool operator()(key k1, key k2)
    {
        return k1.ff > k2.ff || (k1.ff == k2.ff && k1.ss < k2.ss);
    }
};

main()
{
    f(i, 0, 200001) fen[i] = 0;
    int n; cin>>n; int a[n+1]; f(i, 1, n+1) cin>>a[i];
    reverse(a+1, a+n+1);
    f(i, 1, n+1)
        b[i] = a[i] - i + 1;
    set<key, cmp> s;
    f(i, 1, n+1) s.insert({b[i], i});
    int res[n+1];
//    for(key k : s) cout<<k.ff<<" "<<k.ss<<"\n";
    f(i, 1, n+1)
    {
        key k = *s.begin(); s.erase(s.begin());
        int t = sum(n) - sum(k.ss-1);
        res[i] = k.ff + min(i-t-1, k.ss-1) + t;
    //    cout<<t<<" "<<k.ss<<"\n";
        update(k.ss-1);
    }

    f(i, 2, n+1)
        if(res[i] > res[i-1])
        {
            cout<<":("; return 0;
        }

    reverse(res+1, res+n+1);
    cout<<"\n"; f(i, 1, n+1) cout<<res[i]<<" ";
}


# include <bits/stdc++.h>
using namespace std;
long long n,ans[300005],f;
pair <long long, long long> a[300005];
int main()
{
     cin>>n;
     for(int i=1; i<=n; i++)
     {
          cin>>a[i].first;
          a[i].first+=i;
          a[i].second=i;
     }
     sort(a+1, a+n+1);
     for(int i=1; i<=n; i++)
     {
          ans[i]=a[i].first-i;
     }
     for(int i=1; i<=n; i++)
     {
          if (ans[i]<ans[i-1]) f=1;
     }
     if(f)
     {
          cout<<":("<<endl;
          return 0;
     }
     for(int i=1; i<=n; i++)
     {
          cout<<ans[i]<<" ";
     }
     cout<<endl;
}


#include <iostream>
#include <deque>
#include <vector>
#include <cmath>
#include <stdio.h>
#include <iomanip>
#include <queue>
#include <time.h>
#include <set>
#include <cstring>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <bitset>
#include <unordered_set>
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define In insert
using namespace std;
typedef long long ll;
const int inf = 1e9 + 7, maxn = 2e5 + 100;
vector <int> v;
int b[maxn];

int main(){
    ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		int k;
		cin >> k;
		b[i] = k + i + 1;
	}
	sort (b, b + n);
	for (int i = 1; i < n; i++)
		if (b[i] == b[i - 1])
			return cout << ":(" << endl, 0;
	for (int i = 0; i < n; i++){
		cout << b[i] - i - 1 << " ";
	}
}


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

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr<<endl;}
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << "=" << a << " # ";
	err(++it, args...);
}

using LL=long long;
const int N = 1e6 + 5, INF = 0x3f3f3f3f;

int a[N];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
//    freopen("o1.txt","w",stdout);
#endif
	ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);

	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		a[i]+=i;
	}
	sort(a+1,a+1+n);
	a[1]-=1;
	for(int i=2;i<=n;i++){
		a[i]-=i;
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
		}
	}
	for(int i=1;i<=n;i++)cout<<a[i]<<" ";
	return 0;
}


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

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); cerr<<endl;}
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << "=" << a << " # ";
	err(++it, args...);
}

using LL=long long;
const int N = 1e6 + 5, INF = 0x3f3f3f3f;

int a[N];

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
//    freopen("o1.txt","w",stdout);
#endif
	ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);

	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		a[i]-=i;
	}
	sort(a+1,a+1+n);
	for(int i=1;i<=n;i++){
		a[i]+=i;
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
			}
	}
	for(int i=1;i<=n;i++)cout<<a[i]<<" ";
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn=200005;
int n,a[maxn];
int main()
{
    scanf("%d",&n);
    for (int i=0;i<n;++i) {
        scanf("%d",&a[i]);
        a[i]+=i;
    }
    sort(a,a+n);
    int i=0;
    for (;i<n-1;++i)
        if (a[i]==a[i+1])
            break;
    if (i<n-1)
        puts(":(");
    else
        for (int i=0;i<n;++i)
            printf("%d\n",a[i]-i);
    return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn=200005;
int n,a[maxn];
int main()
{
    scanf("%d",&n);
    for (int i=0;i<n;++i) {
        scanf("%d",&a[i]);
        a[i]+=i;
    }
    sort(a,a+n);
    int i=0;
    for (;i<n-1;++i)
        if (a[i]==a[i+1])
            break;
    if (i<n-1)
        puts(":(");
    else
        for (int i=0;i<n;++i)
            printf("%d\n",a[i]-i);
    return 0;
}
//


/*
author: madhav_1999 aka orthodoxparadox
17 March 2020 at 6:10 PM
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) (int) x.size()
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ")
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << 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 dbg(...) 42
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}

void solve()
{
	int n;
	cin >> n;
	int a[n + 1]{};
	pii b[n + 1]{};
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
		b[i] = make_pair(a[i] + i, i);
	}
	sort(b + 1, b + n + 1);
	for(int i = 1; i <= n; i++) {
		if(b[i].ff == b[i - 1].ff) {
			cout << ":(";
			return;
		}
	}
	for(int i = 1; i <= n; i++) {
		cout << b[i].ff - i << " ";
	}
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int t = 1;
	// cin >> t;
	while(t--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}


/*
author: madhav_1999 aka orthodoxparadox
17 March 2020 at 6:10 PM
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define dbl long double
#define int ll
#define ll long long
#define pii pair<int, int>
#define len(x) (int) x.size()
#define rev(a) reverse(all(a))
#define oiint ostream_iterator<int>(cout, " ")
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define initialise(a, x) memset(a, x, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
#define inf 2e18
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef MADHAV
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << 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 dbg(...) 42
#endif
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(int i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
struct pair_hash {inline std::size_t operator()(const std::pair<int, int> & v) const {return v.first*31+v.second;}};
const int MOD = 1e9 + 7;

int takemod(int a, int mod = MOD){a%=mod;if(a<0)a+=mod;return a;}

int fast_exp(int base, int expo, int mod = MOD) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;}
	return res;}

int modinv(int a, int mod = MOD){return takemod(fast_exp(takemod(a), mod-2, mod), mod);}

void solve()
{
	int n;
	cin >> n;
	int a[n + 1]{};
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
		a[i] += i;
	}
	sort(a + 1, a + n + 1);
	for(int i = 1; i <= n; i++) {
		if(a[i] == a[i - 1]) {
			cout << ":(";
			return;
		}
	}
	for(int i = 1; i <= n; i++) {
		cout << a[i] - i << " ";
	}
}

signed main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	#ifdef MADHAV
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	clock_t t1, t2;
	t1 = clock();

	int t = 1;
	// cin >> t;
	while(t--)
	{
		solve();
	}
	#ifdef MADHAV
	t2 = clock(); cerr << "time taken: " << (t2-t1)/(dbl)CLOCKS_PER_SEC;
	#endif
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int a[MAXN];
int main () {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i], a[i] -= n - i;
    sort(a, a + n);
    for (int i = 1; i < n; ++i)
        if (a[i] == a[i - 1])
            return cout << ":(", 0;
    for (int i = 0; i < n; ++i)
        cout << a[i] + n - i << ' ';
    return 0;
}


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

const int maxn = 2e5 + 10, inf = 1e9 + 1;
int ans[maxn], a[maxn];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    vector<pair<int, int>> vec;
    for (int i = 1; i <= n; ++i) cin >> a[i], vec.emplace_back(a[i] + i, i);
    sort(vec.begin(), vec.end());
    for (size_t i = 0; i < vec.size(); ++i) {
        ans[i] = a[vec[i].second] + vec[i].second - 1 - i;
    }
    int cur = inf;
    for (int i = n - 1; i >= 0; --i) {
        if (cur < ans[i]) return cout << ":(" << endl, 0;
        cur = min(cur, ans[i]);
    }
    for (int i = 0; i < n; ++i) cout << ans[i] << ' '; cout << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int NICO = 200000+10;

struct Item
{
    int val, pos;
} it[NICO];

bool cmp(Item A, Item B)
{
    /*
    if (A.val - 2*A.pos == B.val - 2*B.pos)
        return A.pos > B.pos;
    */

    return (A.val - B.val) > (B.pos - A.pos);
}

int n;
vector<int> res;

int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; i ++)
    {
        scanf("%d", &it[i].val);
        it[i].pos = i;
    }

    sort(it + 1, it + 1 + n, cmp);

    int ok = 1;
    for (int i = 1; i <= n; i ++)
    {
        res.push_back( it[i].val - (n - i + 1 - it[i].pos) );
    }

    for (int i = 1; i < res.size(); i ++)
    {
        if (res[i] > res[i-1]) ok = 0;
    }

    if (!ok)
    {
        printf(":(\n");
        return 0;
    }

    for (int i = res.size() - 1; i>= 0; i --)
    {
        printf("%d ", res[i]);
    }
}


// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimize("02")
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
#define use_file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;
using ll = long long;
const ll N=2e5+5,inf=4e18;
ll n,a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	ll q=501;
	while(q--){
		for(int i=n;i>0;i--){
			if(a[i]<a[i-1]-1){
				swap(a[i],a[i-1]);
				a[i-1]++;
				a[i]--;
			}
		}
	}
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
		}
	}
	for(int i=0;i<n;i++)cout<<a[i]<<" ";
	return 0;
}


// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimize("02")
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
#define use_file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;
using ll = long long;
const ll N=2e5+5,inf=4e18;
ll n,a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	ll q=501;
	while(q--){
		for(int i=n-1;i>0;i--){
			if(a[i]<a[i-1]-1){
				swap(a[i],a[i-1]);
				a[i-1]++;
				a[i]--;
			}
		}
	}
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
		}
	}
	for(int i=0;i<n;i++)cout<<a[i]<<" ";
	return 0;
}


// In the name of god
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
using ll = long long;
const ll N=2e5+5 , inf=4e18;
ll n , a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin >> n ;
	for( ll i = 0 ; i < n ; i++ ){
		cin >> a[i];
		a[i] +=i;
	}
	sort ( a , a + n );
	for( ll i = 1 ; i < n ; i++ ){
		if( a[i] == a[i-1] ){
			cout << ":(" << endl;
			return 0;
		}
	}
	for( ll i = 0 ; i < n ; i++)
		cout << a[i]-i << ' ' ;
	cout << endl ;
}


// In the name of god
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
using ll = long long;
const ll N=2e5+5 , inf=4e18;
ll n , a[N];
pair < ll , ll > p[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin >> n ;
	for( ll i = 0 ; i < n ; i++ ){
		cin >> a[i];
		p[i]={a[i]+i,i};
	}
	sort ( p , p+n );
	for( ll i = 1 ; i < n ; i++ ){
		if( p[i].F == p[i-1].F ){
			cout << ":(" << endl;
			return 0;
		}
	}
	for( ll i = 0 ; i < n ; i++)
		cout << p[i].F-i << ' ' ;
	cout << endl ;
}


// In the name of god
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
using ll = long long;
const ll N=2e5+5 , inf=4e18;
ll n , a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin >> n ;
	for(int i = 0 ; i < n ; i++ ){
		cin >> a[i];
		a[i] += i;
	}
	sort ( a , a+n );
	for( int i = 1 ; i < n ; i++ ){
		if( a[i] == a[i-1] ){
			cout << ":(" << endl;
			return 0;
		}
	}
	for( int i = 0 ; i < n ; i++)
		cout << a[i] << ' ' ;
	cout << endl ;
}


// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimize("02")
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
#define use_file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;
using ll = long long;
const ll N=2e5+5,inf=4e18;
ll n,a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	ll q=501;
	while(q--){
		for(int i=1;i<n;i++){
			if(a[i]<a[i-1]-1){
				swap(a[i],a[i-1]);
				a[i-1]++;
				a[i]--;
			}
		}
	}
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
		}
	}
	for(int i=0;i<n;i++)cout<<a[i]<<" ";
}


// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimize("02")
#define F first
#define S second
#define pb push_back
#define all(x) x.begin() , x.end()
#define use_file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
using namespace std;
using ll = long long;
const ll N=2e5+5,inf=4e18;
ll n,a[N];
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	ll q=501;
	while(q--){
		for(int i=1;i<n;i++){
			if(a[i]<a[i-1]-1){
				swap(a[i],a[i-1]);
				a[i-1]++;
				a[i]--;
			}
		}
	}
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			cout<<":("<<endl;
			return 0;
		}
	}
	for(int i=0;i<n;i++)cout<<a[i]<<" ";
	return 0;
}


#include <bits/stdc++.h>

#define MAXN 200200

using namespace std;

int main(){
	int n; scanf("%d",&n);
	int a[MAXN]; int base[MAXN]; int b[MAXN];
	for(int i = 0; i < n; i++){
		scanf("%d", a+i);
		base[i] = n - 1 - i;
		b[i] = a[i] - base[i];
	}
	sort(b, b+n);
	bool flag = true;
	for(int i = 0; i < n; i++){
		a[i] = base[i] + b[i];
		if(i&&a[i] < a[i-1]){
			flag = false; break;
		}
	}
	if(flag==false) printf(":(\n");
	else{
		for(int i=0;i<n;i++) printf("%d%c", a[i], (i == n-1) ? 10 : 32);
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector <int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        a[i]+=i;
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        a[i]-=i;
        if(i & a[i]<a[i-1]){
            cout << ":(" << endl;
            return 0;
        }
    }
    for(int i=0;i<n;i++){
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector <int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        a[i]+=i;
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        a[i]-=i;
        if(i && a[i]<a[i-1]){
            cout << ":(" << endl;
            return 0;
        }
    }
    for(int i=0;i<n;i++){
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int N=2e5+10;

int n, a[N], b[N];

int main() {
	scanf("%d", &n);
	for(int i=1; i<=n; i++) scanf("%d", &a[i]), b[i]=a[i]-(n-i+1);
	sort(b+1, b+n+1);
	for(int i=1; i<=n; i++) {
		a[i]=b[i]+(n-i+1);
	}
	int ok=1;
	for(int i=2; i<=n; i++) {
		if (a[i]<a[i-1]) ok=0;
	}
	if (ok) {
		for(int i=1; i<=n; i++) {
			cout<<a[i];
			if (i==n) cout<<endl;
			else cout<<' ';
		}
	}
	else cout<<":("<<endl;

	return 0;
}


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

const int maxn = 200005;
int a[maxn], n;

int main() {
	scanf("%d", &n);
	for (int i=1; i<=n; i++) {
		scanf("%d", &a[i]);
		a[i] = a[i] - (n - i);
	}
	sort(a+1, a+n+1);
	for (int i=1; i<=n; i++)
		if (i < n && a[i] == a[i+1]
		 || a[i] + (n - i) < 0)
				return puts(":("), 0;
	for (int i=1; i<=n; i++)
		printf("%d ", a[i] + (n - i));
	return 0;
}


//#pragma GCC optimize(2)
//#pragma GCC optimize(3)
//#pragma GCC optimize(4)
//#pragma GCC optimize("unroll-loops")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
//#include <bits/extc++.h>
#define fi first
#define se second
#define db double
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define pi acos(-1.0)
#define ll long long
#define vi vector<int>
#define mod 1000000007
#define ld long double
//#define C 0.5772156649
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pii pair<int,int>
#define ull unsigned long long
#define bpc __builtin_popcount
//#define base 1000000000000000000
#define fin freopen("a.txt","r",stdin)
#define fout freopen("a.txt","w",stdout)
#define fio ios::sync_with_stdio(false);cin.tie(0)
#define mr mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
inline ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
inline void sub(ll &a,ll b){a-=b;if(a<0)a+=mod;}
inline void add(ll &a,ll b){a+=b;if(a>=mod)a-=mod;}
template<typename T>inline T const& MAX(T const &a,T const &b){return a>b?a:b;}
template<typename T>inline T const& MIN(T const &a,T const &b){return a<b?a:b;}
inline ll qp(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod,b>>=1;}return ans;}
inline ll qp(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=ans*a%c;a=a*a%c,b>>=1;}return ans;}

using namespace std;
//using namespace __gnu_pbds;

const ull ba=233;
const db eps=1e-5;
const ll INF=0x3f3f3f3f3f3f3f3f;
const int N=200000+10,maxn=1000000+10,inf=0x3f3f3f3f;

int a[N];
int main()
{
    int n;scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]),a[i]-=n-i+1;
    sort(a+1,a+1+n);
    for(int i=1;i<n;i++)if(a[i]+n-i+1>a[i+1]+n-i)return 0*puts(":(");
    for(int i=1;i<=n;i++)printf("%d ",a[i]+n-i+1);
    return 0;
}
/********************

********************/


#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

const int MAXN = 2e5 + 10;
vector<pair<int, int> > vc;
int n;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		vc.push_back({ a + i, a });
	}
	sort(vc.begin(), vc.end());
	for (int i = 1; i < n; i++)
		if (vc[i].first == vc[i - 1].first)
			return cout << ":(", 0;
	for (int i = 0; i < n; i++) {
		cout << vc[i].first - i << ' ';
	}
}


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

const int MAXN=211111;
int n, m;
int a[MAXN];

int main() {
    scanf("%d", &n);
    for(int i=1;i<=n;++i) {
        scanf("%d", &a[i]);
        a[i]-=n-i;
    }
    sort(a+1, a+1+n);
    for(int i=1;i<=n;++i) {
        a[i]+=n-i;
        if(i>1 && a[i]<a[i-1]) {
            puts(":(");
            return 0;
        }
    }
    for(int i=1;i<=n;++i) {
        printf("%d ", a[i]);
    }puts("");
    return 0;
}


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

// This code uses the bossle/cp library
// Available at https://github.com/bossle/cp

typedef long long int lli;

// #pragma STDC FENV_ACCESS OFF
// #pragma STDC FP_CONTRACT ON
// #pragma STDC CX_LIMITED_RANGE ON
// #pragma GCC optimize "O3"

namespace cp_base {

auto init = (
  ios::sync_with_stdio(false),
  cin.tie(nullptr)
);

}  // namespace cp_base

#define LOG(x)

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int& i : a)
    cin >> i;
  vector<int> val(n);
  for (int i=0; i<n; ++i)
    val[i] = a[i] + i;
  sort(val.begin(), val.end());
  vector<int> ans(n);
  for (int i=0; i<n; ++i)
    ans[i] = val[i] - i;
  for (int i=1; i<n; ++i)
    if (ans[i-1] > ans[i]) {
      cout << ":(" << endl;
      return 0;
    }
  for (int i : ans)
    cout << i << ' ';
}


#include<bits/stdc++.h>
using namespace std;
int a[200005];
set<int> s;
int main(){
    int n,i,x=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        s.insert(a[i] -(n-1-i));
    }
    if(s.size() <n){
        printf(":(");
        return 0;
    }
    auto it =s.end();
    for(i=n-1;i>=0;i--){
        it--;
        a[i] = *it +x;
        x++;
    }
    for(i=0;i<n;i++)
        printf("%d ",a[i]);
}


#include<bits/stdc++.h>
using namespace std;
int a[100005];
set<int> s;
int main(){
    int n,i,x=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        s.insert(a[i] -(n-1-i));
    }
    if(s.size() <n){
        printf(":(");
        return 0;
    }
    auto it =s.end();
    for(i=n-1;i>=0;i--){
        it--;
        a[i] = *it +x;
        x++;
    }
    for(i=0;i<n;i++)
        printf("%d ",a[i]);
}


#include <bits/stdc++.h>

#define VARNAME(x) #x
#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using ld = long double;

template <typename T>
vector<T> Vec(int n, T v)
{
    return vector<T>(n, v);
}
template <class... Args>
auto Vec(int n, Args... args)
{
    auto val = Vec(args...);
    return vector<decltype(val)>(n, move(val));
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}

constexpr ll MOD = (ll)1e9 + 7LL;
constexpr ld PI = static_cast<ld>(3.1415926535898);
template <typename T>
constexpr T INF = numeric_limits<T>::max() / 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<ll> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        a[i] = a[i] - (N - 1 - i);
    }
    sort(a.begin(), a.end());
    for (int i = 1; i <= N; i++) {
        a[i - 1] += N - i;
    }
    for (int i = 0; i < N - 1; i++) {
        if (a[i] < 0 or a[i] > a[i + 1]) {
            cout << ":(" << endl;
            return 0;
        }
    }
    for (int i = 0; i < N; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}


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

vector<int> v;

int main()
{
	int N;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		int x;
		cin >> x;
		v.push_back(x + i);
	}
	sort(v.begin(), v.end());
	for (int i = 1; i < v.size(); i++)
		if (v[i] == v[i-1])
		{
			cout << ":(";
			return 0;
		}
	for (int i = 0; i < v.size(); i++)
		cout << v[i] - i << " ";
}


#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i,l,r) for(int i = (int)l;i<(int)r;i++)
#define td(v) v.begin(),v.end()
#define sz(v) (int)v.size()
//#define M   1000000007 // 1e9 + 7
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
inline ll mod(ll n, ll m){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll a,ll b,ll m){

    if(b==0LL) return 1LL;
    if(b==1LL) return mod(a,m);
    ll k = mod(exp(a,b/2,m),m);
    if(b&1LL){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

struct BIT{
 int n;
 int MAX;
 vector<int> bit;
 BIT(){}
 BIT(int _n){
   n = _n;
   MAX = n +2;
   bit.resize(n+10,0);
 }

 int query(int x){
   int r=0;
   while(x>0){
     r+=bit[x];
     x-=(x&-x);
   }
   return r;
 }

 int query(int l,int r){
   return query(r) - query(l-1);
 }

 void update(int x,int val){
   while(x<MAX){
     bit[x]+=val;
     x+=(x&-x);
   }
 }

 int find_kth(int k){
   int sum=0;
   int pos=0;
   // 30 == log -> trocar conforme necessario
   for(int i=20;i>=0;i--){
     if(pos+(1LL<<i)>n)continue;
     int atual = bit[pos+(1LL<<i)];
     if(sum+atual<k){
       sum+=atual;
       pos+=(1LL<<i);
     }

   }

   //acha a maior pos com <k;
   return pos+1;
 }

};

const int N = 200100;
int a[N];

const int MAXN = 200100;
ll tree[4*MAXN];
ll lazy[4*MAXN];
int n;

void build(int no,int i,int j){
  if(i==j){
    tree[no] = a[i] - (n-i);
 //   cout<<"INI "<<i<<" "<<tree[no]<<endl;
  }else{
    int m = (i+j)/2;
    int l = 2*no,r=2*no+1;
    build(l,i,m);
    build(r,m+1,j);
    tree[no] = max(tree[l],tree[r]);
  }
}

void propagate(int no,int i,int j){
  if(lazy[no]==0)return;
  tree[no]+=lazy[no];
  if(i!=j){
    lazy[2*no]+=lazy[no];
    lazy[2*no+1]+=lazy[no];
  }
  lazy[no] = 0;
}

void update(int no,int i,int j,int a,int b,int v){
  propagate(no,i,j);
  if(a>b)return;
  if(i>b || j<a || i>j)return;
  if(a<=i && j<=b){
    tree[no] += v;
    if(i!=j){
      lazy[2*no]+=v;
      lazy[2*no+1]+=v;
    }
    return;
  }
  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;
  update(l,i,m,a,b,v);
  update(r,m+1,j,a,b,v);
  tree[no] = max(tree[l],tree[r]);
}

int query(int no,int i,int j){
  propagate(no,i,j);
  if(i==j)return i;
  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;
  propagate(2*no,i,j);
  propagate(2*no+1,i,j);
  if(tree[l] >= tree[r])return query(l,i,m);
  return query(r,m+1,j);
}

int query2(int no,int i,int j,int a,int b){
  if(i>b || j<a || i>j)return 1e15;

  propagate(no,i,j);

  if(a<=i && j<=b)return tree[no];

  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;

  return min(query2(l,i,m,a,b),query2(r,m+1,j,a,b));
}

int b[N];
// long long ?
int32_t main(){
  fastio;
  cin>>n;
  //node ini;
  //ini.x=0;
  for(int i=1;i<=n;i++){
    cin>>a[i];
  }
  build(1,1,n);

  for(int i=n;i>=1;i--){
    int pos = query(1,1,n);

    b[i] = query2(1,1,n,pos,pos);
 //   if(pos < i)b[i]+=n-i;
  //  else b[i]+=n-pos;

    update(1,1,n,1,n,1);
    update(1,1,n,pos,pos,-1e15);
  }
  int mn = 1e9;
  for(int i=n;i>=1;i--){
    if(b[i] > mn){
      cout<<":("<<endl;
      return 0;
    }
    mn = min(mn,b[i]);
  }
  for(int i=1;i<=n;i++){
    cout<<b[i]<<" ";
  }
  cout<<endl;

  // Math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}


#include <bits/stdc++.h>
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i,l,r) for(int i = (int)l;i<(int)r;i++)
#define td(v) v.begin(),v.end()
#define sz(v) (int)v.size()
//#define M   1000000007 // 1e9 + 7
#define int long long
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
inline ll mod(ll n, ll m){ ll ret = n%m; if(ret < 0) ret += m; return ret; }
ll gcd(ll a, ll b){return (b == 0LL ? a : gcd(b, a%b));}
ll exp(ll a,ll b,ll m){

    if(b==0LL) return 1LL;
    if(b==1LL) return mod(a,m);
    ll k = mod(exp(a,b/2,m),m);
    if(b&1LL){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

struct BIT{
 int n;
 int MAX;
 vector<int> bit;
 BIT(){}
 BIT(int _n){
   n = _n;
   MAX = n +2;
   bit.resize(n+10,0);
 }

 int query(int x){
   int r=0;
   while(x>0){
     r+=bit[x];
     x-=(x&-x);
   }
   return r;
 }

 int query(int l,int r){
   return query(r) - query(l-1);
 }

 void update(int x,int val){
   while(x<MAX){
     bit[x]+=val;
     x+=(x&-x);
   }
 }

 int find_kth(int k){
   int sum=0;
   int pos=0;
   // 30 == log -> trocar conforme necessario
   for(int i=20;i>=0;i--){
     if(pos+(1LL<<i)>n)continue;
     int atual = bit[pos+(1LL<<i)];
     if(sum+atual<k){
       sum+=atual;
       pos+=(1LL<<i);
     }

   }

   //acha a maior pos com <k;
   return pos+1;
 }

};

const int N = 200100;
int a[N];

const int MAXN = 200100;
ll tree[4*MAXN];
ll lazy[4*MAXN];
int n;

void build(int no,int i,int j){
  if(i==j){
    tree[no] = a[i] - (n-i);
 //   cout<<"INI "<<i<<" "<<tree[no]<<endl;
  }else{
    int m = (i+j)/2;
    int l = 2*no,r=2*no+1;
    build(l,i,m);
    build(r,m+1,j);
    tree[no] = max(tree[l],tree[r]);
  }
}

void propagate(int no,int i,int j){
  if(lazy[no]==0)return;
  tree[no]+=lazy[no];
  if(i!=j){
    lazy[2*no]+=lazy[no];
    lazy[2*no+1]+=lazy[no];
  }
  lazy[no] = 0;
}

void update(int no,int i,int j,int a,int b,int v){
  propagate(no,i,j);
  if(a>b)return;
  if(i>b || j<a || i>j)return;
  if(a<=i && j<=b){
    tree[no] += v;
    if(i!=j){
      lazy[2*no]+=v;
      lazy[2*no+1]+=v;
    }
    return;
  }
  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;
  update(l,i,m,a,b,v);
  update(r,m+1,j,a,b,v);
  tree[no] = max(tree[l],tree[r]);
}

int query(int no,int i,int j){
  propagate(no,i,j);
  if(i==j)return i;
  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;
  propagate(2*no,i,j);
  propagate(2*no+1,i,j);
  if(tree[l] >= tree[r])return query(l,i,m);
  return query(r,m+1,j);
}

int query2(int no,int i,int j,int a,int b){
  if(i>b || j<a || i>j)return 1e15;

  propagate(no,i,j);

  if(a<=i && j<=b)return tree[no];

  int m = (i+j)/2;
  int l = 2*no,r=2*no+1;

  return min(query2(l,i,m,a,b),query2(r,m+1,j,a,b));
}

int b[N];
// long long ?
int32_t main(){
  fastio;
  cin>>n;
  //node ini;
  //ini.x=0;
  for(int i=1;i<=n;i++){
    cin>>a[i];
  }
  build(1,1,n);

  for(int i=n;i>=1;i--){
    int pos = query(1,1,n);

    b[i] = query2(1,1,n,pos,pos);
    if(pos < i)b[i]+=n-i;
    else b[i]+=n-pos;
   // cout<<pos<<" "<<b[i]<<endl;
 //   cout<<pos<<" "<<query2(1,1,n,pos,pos)<<endl;
    update(1,1,n,pos+1,n,1);
    update(1,1,n,pos,pos,-1e15);
    //update(1,1,n,1,n,1);
  }
  int mn = 1e9;
  for(int i=n;i>=1;i--){
    if(b[i] > mn){
      cout<<":("<<endl;
      return 0;
    }
    mn = min(mn,b[i]);
  }
  for(int i=1;i<=n;i++){
    cout<<b[i]<<" ";
  }
  cout<<endl;

  // Math -> gcd it all
  // Did u check N=1? Did you switch N,M?
}