import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	} main {
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] num = new int[5]; num new int[5] 5 for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		} int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		} {
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		} num[i] = sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            } num[i] != (i+1) num[i] num 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){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int[] num = new int[5];
		for(int i=0;i<5;i++){
			num[i] = sc.nextInt();
          	if( num[i] != (i+1) ){
              System.out.println( (i+1) );
            }
		}
		//System.out.println(ans);    	
	}
}