import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    }
} Main public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    } main {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String tokens1[] = scanner.nextLine().split(" "); tokens1 scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " String tokens3[] = scanner.nextLine().split(" "); tokens3 scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " scanner.close() scanner.close scanner if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        } tokens1[0].equals(tokens3[0]) tokens1[0].equals tokens1[0] tokens1 0 tokens3[0] tokens3 0 {
            a--;
        } a-- a {
            b--;
        } b-- b 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) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String tokens1[] = scanner.nextLine().split(" ");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        scanner.nextLine().split(" ");
        String tokens3[] = scanner.nextLine().split(" ");
        
        /*
        System.out.println(Arrays.asList(tokens1));
        System.out.println(a);
        System.out.println(b);
        System.out.println(Arrays.asList(tokens3));
        */
        scanner.close();

        if (tokens1[0].equals(tokens3[0])) {
            a--;
        } else {
            b--;
        }
        System.out.println(a + " " + b);
    }
}