import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int[][] rs = new int[2][2]; for (int i = 0 ; i < 2 ; i++){ for (int j = 0 ; j < 2 ; j++){ rs[i][j] = sc.nextInt(); } } int[][] ans = new int[2][2]; for(int i = 0 ; i < 2 ; i++){ if(i == 0){ ans = calc(rs , rs); }else{ ans = calc(ans , rs); } } for(int i = 0 ; i < 2 ; i++){ for(int j = 0 ; j < 2 ; j++){ System.out.print(ans[i][j]+" "); } System.out.println(); } } private static int[][] calc(int[][] rs1 , int[][] rs2){ int[][] ans = new int[2][2]; for(int i = 0 ; i < 2 ; i++){ for(int j = 0 ; j < 2 ; j++){ for(int k = 0 ; k < 2 ; k++){ ans[i][j] += rs1[i][k] * rs2[k][j]; } } } return ans; } }