#include<iostream>
#include<cmath>
#include<math.h>
#include<string>
#include <fstream>
#include <cctype>
#include <iomanip>
#include <algorithm>
using namespace std;
int main()
{
	freopen("DATA3.txt","r",stdin);
	freopen("OUT3.txt","w",stdout);
	int x,y,z;
	int n,arr[102],arr2[101];
	for(x=0;x<5;x++)
	{
		cin >> n;
		for(z=0;z<101;z++)
			arr2[z]=0;
		for(z=0;z<102;z++)
			arr[z]=0;
		for(y=0;y<=n+1;y++)
			arr[y]=y;
		for(y=0;y<n;y++)
			cin >> arr2[y];
		for(y=0;y<=n;y++)
		{
			for(z=0;z<101;z++)
			{
				if(arr[y]==arr2[z] && arr[y]!=0)
				{
					arr2[z]=arr[y]=0;
					break;
				}
			}
		}
		for(z=0;z<102;z++)
			if(arr[z]!=0)
			{
				cout << arr[z];
				break;
			}
		cout << endl;

	}
	return(0);
}
