Problem:
Score: 100 points

Problem Statement

Takahashi is solving quizzes. He has easily solved all but the last one.

The last quiz has three choices: 1, 2, and 3.

With his supernatural power, Takahashi has found out that the choices A and B are both wrong.

Print the correct choice for this problem.

Constraints

Each of the numbers A and B is 1, 2, or 3.

A and B are different.

Input

Input is given from Standard Input in the following format:

A
B

Output

Print the correct choice.

Sample Input 1

3
1

Sample Output 1

2

When we know 3 and 1 are both wrong, the correct choice is 2.

Sample Input 2

1
2

Sample Output 2

3

Solution in Java (OpenJDK 11.0.6) (judge verdict: Accepted)

import java.util.*;


public class Main {
     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
//        String s = sc.nextLine();
//        int k = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
//        int c = sc.nextInt(); 
//        int r = sc.nextInt();
//        int x = sc.nextInt();
//        int s = sc.nextInt();
//        int n = sc.nextInt(); 
//        int r = sc.nextInt(); 
//        String s = sc.next();
//        String t = sc.next();
//        int n = sc.nextInt();
//        int m = sc.nextInt();
//        char c = sc.next().charAt(0);
        sc.close();
        Integer array[] = {a,b};
        if(!Arrays.asList(array).contains(1)){
            System.out.println(1);
        }else if(!Arrays.asList(array).contains(2)){
            System.out.println(2);
        }else{
            System.out.println(3);
        }
//        if(k * 500 >= x){
//            System.out.println("Yes");
//        }else{
//            System.out.println("No");
//        }
//        char[] alphabet = "abcdefghijklmnopqrstuvwxyz".toCharArray();
//        int i = 0;
//        for(;;){
//            if(alphabet[i] == c){
//                break;
//            }
//            i ++;
//        }
//        System.out.println(alphabet[i+1]);
//        if(n == m){
//            System.out.println("Yes");
//        }else{
//            System.out.println("No");
//        }
//        int count = 0;
//        for(;;){
//            if(h<=0){
//                break;
//            }
//            h -= a;
//            count ++;
//        }
////        System.out.println(h);
//        System.out.println(count);
//        String[] arr =  s.split(" ");
////        System.out.println(arr[0]);
//        System.out.println(arr[1]);
//        System.out.println(a);
//        System.out.println(b);
//        System.out.println(u);
//        if(arr[0].equals(u)){
//            a -= 1;
//            System.out.println(a+" "+b);
//        }else{
//            b -= 1;
//            System.out.println(a+" "+b);
//        }
//        List<Integer> list = Arrays.asList(a,b,c);
////        System.out.println(list);
//        List<Integer> list2 = new ArrayList<Integer>(new HashSet<>(list));
//        if(list2.size() == 2){
//            System.out.println("Yes");
//        }else{
//            System.out.println("No");
//        }
//        System.out.println(list2);
//        if(n >= 10){
//            System.out.println(r);
//        }else{
//            System.out.println(r + 100*(10-n));
//        }
//        if(n % 2 == 0){
//            n = (n/2);
//            System.out.println(n);
//        }else{
//            n = n/2 + 1;
//            System.out.println(n);
//        }
//        int sum = 0;
//        sum = n*(n-1)/2 + m*(m-1)/2;
//        System.out.println(sum);
//        String[] arr =  s.split("");
//         System.out.println("arr[2]: "+arr[2]);
//          System.out.println("arr[3]: "+arr[3]);
//           System.out.println("arr[4]: "+arr[4]);
//            System.out.println("arr[5]: "+arr[5]);
//        if(arr[2].equals(arr[3]) && arr[4].equals(arr[5])){
//            System.out.println("Yes");
//        }else{
//            System.out.println("No");
//        }
//        System.out.println(z + " " + x + " " + y);
//        if(n.contains("7")){
//            System.out.println("Yes");
//        }else{
//            System.out.println("No");
//        }
//        System.out.println(n);
//        if(s <= w){
//            System.out.println(Math.PI);
//        }else{
//            System.out.println("safe");
//        }
//        System.out.println(s);
//        if(s.contains("RRR")){
//            System.out.println(3);
//        }else if(s.contains("RR")){
//            System.out.println(2); 
//        }else if(s.contains("R")){
//            System.out.println(1);
//        }else{
//             System.out.println(0);
//        }
//        String s = sc.nextLine();
//        String t = sc.next();
//        String[] arr =  s.split("　");
//        sc.close();
//        System.out.println("input: "+ s);
//        System.out.println("k:" + k);
//        System.out.println("a:" + a);
//        System.out.println("b:" + b);
//        String ans = "NG";
//        for(int x = a; x<=b; x++){
//            if(x%k == 0){
//                ans = "OK";
//            }
//        }
//        System.out.println(ans);
//        \
//        System.out.println("arr[1]:" + arr[1]);
//
//        if(s.equals("ABC")){
//            System.out.println("ARC");
//        }else{
//            System.out.println("ABC");
//        }
//        String[] arr1 =  s.split("");
//        String[] arr2 =  t.split("");
////        List<String> list1 = Arrays.asList(s.split(""));
//        List list1 = new LinkedList(Arrays.asList(s.split("")));
////        List<String> list2 = Arrays.asList(t.split(""));
//        List list2 = new LinkedList(Arrays.asList(t.split("")));
////        int num = Integer.parseInt(arr[arr.length - 1]);
//        list2.remove(arr2.length - 1);
////        System.out.println(list1);
////        System.out.println(list2);
//         if(list1.toString().contentEquals(list2.toString())){
//             System.out.println("Yes");
//         }else{
//             System.out.println("No");
//         }
//        switch(num){
//            case 3:
//                System.out.println("bon");
//                break;
//            case 0:
//            case 1:
//            case 6:
//            case 8:
//                System.out.println("pon");
//                break;
//            default:
//                System.out.println("hon");
//                break;
//        }
//        String[] array = str.split(" ");
//        int sum = 0;
//        for(int i=0; i<array.length; i++) {
//            int num = Integer.parseInt(array[i]);
//            sum += num;
//        }
//        System.out.println(15-sum);
    }
}