import java.util.Scanner;

public class Main {

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

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	}

} import java.util.Scanner; Scanner java.util public class Main {

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

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	}

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	} main {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] str = line.split(" "); str line.split(" ") line.split line " " String[] num = sc.nextLine().split(" "); num sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " String strU = sc.nextLine(); strU sc.nextLine() sc.nextLine sc String strS = str[0]; strS str[0] str 0 String strT = str[1]; strT str[1] str 1 int numA = Integer.parseInt(num[0]); numA Integer.parseInt(num[0]) Integer.parseInt Integer num[0] num 0 int numB = Integer.parseInt(num[1]); numB Integer.parseInt(num[1]) Integer.parseInt Integer num[1] num 1 if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        } strU.equals(strS) strU.equals strU strS {
        	numA -= 1;
        } numA -= 1 numA 1 {
        	numB -= 1;
        } numB -= 1 numB 1 System.out.println(numA+" "+numB) System.out.println System.out System System.out numA+" "+numB numA+" "+numB numA " " numB String[] args args public class Main {

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

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	}

} public class Main {

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

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	}

} Main
import java.util.Scanner;

public class Main {

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

        String[] str = line.split(" ");
        String[] num = sc.nextLine().split(" ");
        String strU = sc.nextLine();

        String strS = str[0];
        String strT = str[1];

        int numA = Integer.parseInt(num[0]);
        int numB = Integer.parseInt(num[1]);

        if(strU.equals(strS)) {
        	numA -= 1;
        }else {
        	numB -= 1;
        }

        System.out.println(numA+" "+numB);

	}

}
