import java.util.Scanner;

public class Main
{

	public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	}

} import java.util.Scanner; Scanner java.util public class Main
{

	public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	}

} Main public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	} main {

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	} int[] x = new int[5]; x new int[5] 5 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) x[0] = sc.nextInt() x[0] x 0 sc.nextInt() sc.nextInt sc x[1] = sc.nextInt() x[1] x 1 sc.nextInt() sc.nextInt sc x[2] = sc.nextInt() x[2] x 2 sc.nextInt() sc.nextInt sc x[3] = sc.nextInt() x[3] x 3 sc.nextInt() sc.nextInt sc x[4] = sc.nextInt() x[4] x 4 sc.nextInt() sc.nextInt sc sc.close() sc.close sc for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		} {
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		} if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			} x[i] != (i + 1) x[i] x i (i + 1) i 1 {
				System.out.println(i + 1);
			} System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 String args[] args public class Main
{

	public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	}

} public class Main
{

	public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	}

} Main
import java.util.Scanner;

public class Main
{

	public static void main(String args[])
	{

		int[] x = new int[5];

		Scanner sc = new Scanner(System.in);

		x[0] = sc.nextInt();
		x[1] = sc.nextInt();
		x[2] = sc.nextInt();
		x[3] = sc.nextInt();
		x[4] = sc.nextInt();

		sc.close();

		for(int i = 0; i < 5; i++)
		{
			if(x[i] != (i + 1))
			{
				System.out.println(i + 1);
			}
		}
	}

}