import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    }
} Main public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    } main {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    } String inputNameA; inputNameA String inputNameB; inputNameB int numberOfA; numberOfA int numberOfB; numberOfB String choiceName; choiceName Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String inputName = scanner.nextLine(); inputName scanner.nextLine() scanner.nextLine scanner String inputNum = scanner.nextLine(); inputNum scanner.nextLine() scanner.nextLine scanner choiceName = scanner.nextLine() choiceName scanner.nextLine() scanner.nextLine scanner scanner.close() scanner.close scanner String[] editInputName = inputName.split(" "); editInputName inputName.split(" ") inputName.split inputName " " inputNameA = editInputName[0] inputNameA editInputName[0] editInputName 0 inputNameB = editInputName[1] inputNameB editInputName[1] editInputName 1 String[] editInputNum = inputNum.split(" "); editInputNum inputNum.split(" ") inputNum.split inputNum " " numberOfA = Integer.parseInt(editInputNum[0]) numberOfA Integer.parseInt(editInputNum[0]) Integer.parseInt Integer editInputNum[0] editInputNum 0 numberOfB = Integer.parseInt(editInputNum[1]) numberOfB Integer.parseInt(editInputNum[1]) Integer.parseInt Integer editInputNum[1] editInputNum 1 if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        } inputNameA.equals(choiceName) inputNameA.equals inputNameA choiceName {
            numberOfA--;
        } numberOfA-- numberOfA if (inputNameB.equals(choiceName)) {
            numberOfB--;
        } inputNameB.equals(choiceName) inputNameB.equals inputNameB choiceName {
            numberOfB--;
        } numberOfB-- numberOfB System.out.println(numberOfA + " " + numberOfB) System.out.println System.out System System.out numberOfA + " " + numberOfB numberOfA + " " + numberOfB numberOfA " " numberOfB String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        String inputNameA;
        String inputNameB;
        int numberOfA;
        int numberOfB;
        String choiceName;

        Scanner scanner = new Scanner(System.in);
        String inputName = scanner.nextLine();
        String inputNum = scanner.nextLine();
        choiceName = scanner.nextLine();
        scanner.close();

        String[] editInputName = inputName.split(" ");
        inputNameA = editInputName[0];
        inputNameB = editInputName[1];
        String[] editInputNum = inputNum.split(" ");
        numberOfA = Integer.parseInt(editInputNum[0]);
        numberOfB = Integer.parseInt(editInputNum[1]);

        if (inputNameA.equals(choiceName)) {
            numberOfA--;
        } else if (inputNameB.equals(choiceName)) {
            numberOfB--;
        }

        System.out.println(numberOfA + " " + numberOfB);

    }
}