#include <bits/stdc++.h>   using namespace std;   int tab[300000];   vector<int> numbers;   int main() {     int n;     cin >> n;     numbers.resize(n + 10);     vector<int> unused;     for (int i = 1; i <= n; i++) {       cin >> numbers[i];       if (numbers[i] > n || numbers[i] < 1) {         unused.push_back(i);       } else if (tab[numbers[i]] == 0) {         tab[numbers[i]] = i;       } else {         unused.push_back(i);       }     }     for (int i = 1; i <= n; i++) {       if (tab[i] == 0) {         tab[i] = unused.back();         unused.pop_back();       }     }     for (int i = 1; i <= n; i++) {       numbers[tab[i]] = i;     }     for (int i = 1; i <= n; i++) {       cout << numbers[i] <<    ;     }   }   