import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    }
}
class Ball{
    public static int sn;
    public static int tn;
    public static String s;
    public static String t;
    public Ball(String s,String t,int sn,int tn){
        this.sn=sn;
        this.tn=tn;
        this.s=s;
        this.t=t;
    }
    public static void decrement(Ball b,String u){
        if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        }

    }

} import java.util.Scanner; Scanner java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    }
} Main public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    } main {
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt()); b new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt()) Ball.decrement(b,scan.next()) Ball.decrement Ball b scan.next() scan.next scan System.out.print(Ball.sn+" "+Ball.tn) System.out.print System.out System System.out Ball.sn+" "+Ball.tn Ball.sn+" "+Ball.tn Ball.sn Ball Ball.sn " " Ball.tn Ball Ball.tn String[] args args class Ball{
    public static int sn;
    public static int tn;
    public static String s;
    public static String t;
    public Ball(String s,String t,int sn,int tn){
        this.sn=sn;
        this.tn=tn;
        this.s=s;
        this.t=t;
    }
    public static void decrement(Ball b,String u){
        if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        }

    }

} Ball public static int sn; sn public static int tn; tn public static String s; s public static String t; t public Ball(String s,String t,int sn,int tn){
        this.sn=sn;
        this.tn=tn;
        this.s=s;
        this.t=t;
    } Ball {
        this.sn=sn;
        this.tn=tn;
        this.s=s;
        this.t=t;
    } this.sn=sn this.sn this this.sn sn this.tn=tn this.tn this this.tn tn this.s=s this.s this this.s s this.t=t this.t this this.t t String s s String t t int sn sn int tn tn public static void decrement(Ball b,String u){
        if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        }

    } decrement {
        if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        }

    } if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        } u.equals(s) u.equals u s {
            sn-=1;
        } sn-=1 sn 1 {
            tn-=1;
        } tn-=1 tn 1 Ball b b String u u public class Main {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    }
} public class Main {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    }
} Main
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
       Ball b=new Ball(scan.next(),scan.next(),scan.nextInt(),scan.nextInt());
       Ball.decrement(b,scan.next());
       System.out.print(Ball.sn+" "+Ball.tn);

    }
}
class Ball{
    public static int sn;
    public static int tn;
    public static String s;
    public static String t;
    public Ball(String s,String t,int sn,int tn){
        this.sn=sn;
        this.tn=tn;
        this.s=s;
        this.t=t;
    }
    public static void decrement(Ball b,String u){
        if (u.equals(s)){
            sn-=1;
        }else {
            tn-=1;
        }

    }

}