package laba2;

import java.util.Scanner;

public class example7 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Timus 1000 — A + B
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        System.out.println(a + b);

        // Timus 1409 — Two Gangsters
        int harry = scanner.nextInt();
        int larry = scanner.nextInt();
        System.out.println((larry - 1) + " " + (harry - 1));

        // Timus 1264 — Hot Bath
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        System.out.println(n * (m + 1));

        scanner.close();
    }
}