  Program Main

    Implicit None
    Character            :: S*10,T*10,U*10
    Integer              :: A,B

    Read(*,*) S,T
    Read(*,*) A,B
    Read(*,*) U

    If(S==U) A=A-1
    If(T==U) B=B-1

    Write(*,"(I0,x,I0)") A,B

  End Program
