import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    }

} Main public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    } main {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    } InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader reader = new BufferedReader(is); reader new BufferedReader(is) List<String> mylist = new ArrayList<>(); mylist new ArrayList<>() String strinput = reader.readLine(); strinput reader.readLine() reader.readLine reader while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        } strinput != null strinput null {

            mylist.add(strinput);
            strinput = reader.readLine();

        } mylist.add(strinput) mylist.add mylist strinput strinput = reader.readLine() strinput reader.readLine() reader.readLine reader String arr01[] = mylist.get(0).split(" "); arr01 mylist.get(0).split(" ") mylist.get(0).split mylist.get(0) mylist.get mylist 0 " " String arr02[] = mylist.get(1).split(" "); arr02 mylist.get(1).split(" ") mylist.get(1).split mylist.get(1) mylist.get mylist 1 " " String u = mylist.get(2); u mylist.get(2) mylist.get mylist 2 String s = arr01[0]; s arr01[0] arr01 0 String t = arr01[1]; t arr01[1] arr01 1 int a = Integer.valueOf(arr02[0]); a Integer.valueOf(arr02[0]) Integer.valueOf Integer arr02[0] arr02 0 int b = Integer.valueOf(arr02[1]); b Integer.valueOf(arr02[1]) Integer.valueOf Integer arr02[1] arr02 1 if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        } u.equals(s) u.equals u s {
            a -= 1;
        } a -= 1 a 1 {
            b -= 1;
        } b -= 1 b 1 System.out.println(a + " " + b) System.out.println System.out System System.out a + " " + b a + " " + b a " " b String[] args args public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    }

} public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {

        InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(is);

        List<String> mylist = new ArrayList<>();

        // 標準入力からの値を変数strinputに代入
        String strinput = reader.readLine();

        while (strinput != null) {

            mylist.add(strinput);
            strinput = reader.readLine();

        }

        String arr01[] = mylist.get(0).split(" ");
        String arr02[] = mylist.get(1).split(" ");
        String u = mylist.get(2);

        String s = arr01[0];
        String t = arr01[1];

        int a = Integer.valueOf(arr02[0]);
        int b = Integer.valueOf(arr02[1]);

        if (u.equals(s)) {
            a -= 1;
        } else {
            b -= 1;
        }
        System.out.println(a + " " + b);
    }

}
