#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <string>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;

	vector<int> present(2e5 + 1);
	int min_valid = 0;
	int p;
	for (int i = 0; i < n; ++i) {
		cin >> p;
		present[p] = 1;
		while (present[min_valid]) {
			++min_valid;
		}

		cout << min_valid << "\n";
	}

	return 0;

}
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll=long long;
using P=pair<int,int>;
int n;
vector<int> x(210),y(210),r(210);
vector<int> a(210,-1),b(210,-1),c(210,-1),d(210,-1);
void input(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i]>>r[i];
    }
}
void output(){
    rep(i,n){
        cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<" "<<d[i]<<endl;
    }
}
int main(){
    input();
    rep(i,n){
        a[i]=x[i];
        b[i]=y[i];
        c[i]=x[i]+1;
        d[i]=y[i]+1;
    }
    output();
}
