#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ifstream fin("DATA3.txt");
    ofstream fout("OUT3.txt");
    bool list[101];
    int element,temp;
    for (int i=0;i<5;i++){
        for (int j=0;j<101;j++){
            list[j]=false;
        }
        fin>>element;
        for (int j=0;j<element;j++){
            fin>>temp;
            list[temp-1]=true;
        }
        for (int j=0;j<=element;j++){
            if (list[j]==0){
                 fout<<j+1<<endl;
                 break;
            }
        }
    }
    return 0;
}

