#include <iostream>
#include <cstdio>
using namespace std;
const int N = 1e6 + +1e5 + 5;
int fa[N];
bool st[N];
int find(int v)
{
if (!st[v])
{
st[v] = true;
return v;
}
return fa[v] = find(fa[v]);
}
int main()
{
for (int i = 0; i < N; ++i) fa[i] = i+1;
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i)
{
int v;
scanf("%d", &v);
printf("%d ", find(v));
}
return 0;
}