Click Here to go back to the homepage.

Cetvrta Solution:


import java.util.*;

public class Kattis {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] arr= new int[2][3];
        arr[0][0] = sc.nextInt();
        arr[1][0] = sc.nextInt();
        arr[0][1] = sc.nextInt();
        arr[1][1] = sc.nextInt();
        arr[0][2] = sc.nextInt();
        arr[1][2] = sc.nextInt();
        for (int i = 0; i < 2; i++){
            int first = arr[i][0];
            if (arr[i][1] == first)
                System.out.print(arr[i][2] + " ");
            else if (arr[i][2] == first){
                System.out.print(arr[i][1] + " ");
            }
            else
                System.out.print(first + " ");
        }
    }
}