Problem:
 Score : 100 points    Problem Statement  We have A balls with the string S written on each of them and B balls with the string T written on each of them. From these balls, Takahashi chooses one with the string U written on it and throws it away. Find the number of balls with the string S and balls with the string T that we have now.      Constraints   S , T , and U are strings consisting of lowercase English letters.  The lengths of S and T are each between 1 and 10 (inclusive).  S \not= T  S=U or T=U .  1 \leq A,B \leq 10  A and B are integers.         Input  Input is given from Standard Input in the following format:  S  T  A  B  U       Output  Print the answer, with space in between.        Sample Input 1 red blue
3 4
red      Sample Output 1 2 4  Takahashi chose a ball with red written on it and threw it away.
Now we have two balls with the string S and four balls with the string T .       Sample Input 2 red blue
5 5
blue      Sample Output 2 5 4  Takahashi chose a ball with blue written on it and threw it away.
Now we have five balls with the string S and four balls with the string T .

Solution (Python):
s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if u==s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
    a -= 1
else:
    b -= 1
print(a, b)

Solution (Python):
S, T = input().split()
A, B = list(map(int, input().split()))
U = input()

if S == U:
	A -= 1
else:
	B -= 1
print(A, B)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U = input()

if U == S:
    print(A-1,B)
else:
    print(A,B-1)

Solution (Python):
s, t = input().split(" ")
a, b = map(int, input().split(" "))
u = input()

if u == s: a -= 1
else: b -= 1
print(a, b)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()
 
if S == U :
  print(str(A - 1) + ' ' + str(B))
elif T == U :
  print(str(A) + ' ' + str(B - 1))

Solution (Python):
def main():
    s, t = input().split()
    a, b = map(int, input().split())
    u = input()
    if s == u:
        a -= 1
    else:
        b -= 1
    print(a, b)


if __name__ == "__main__":
    main()

Solution (Python):
def solve():
    S,T = input().split()
    A,B = [int(i) for i in input().split()]
    U = input()

    if U == S:
        print(A-1, B)
    else:
        print(A, B-1)

if __name__ == "__main__":
    solve()

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
if S == input():
    A -= 1 
else:
    B -= 1

print(A, B)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if S == U:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}"


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    T = next(tokens)  
    A = int(next(tokens))  
    B = int(next(tokens))  
    U = next(tokens)  
    print(f'{solve(S, T, A, B, U)}')


if __name__ == '__main__':
    main()

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A - 1, B) if S == U else print(A, B - 1)

Solution (Python):
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
if s==u:
    a -= 1
else:
    b -= 1
print(a,b)

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()

if u==s:
  a-=1
else:
  b-=1
print(a,b)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s == u:
  a-=1
else:
  b-=1
print(a,b)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S == U:
    print(A - 1, B)
else:
    print(A, B - 1)

Solution (Python):
s,t = map(str,input().split())
a, b = map(int,input().split())
u = input()


if u == s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
  a -= 1
else:
  b -= 1
print(a,b)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s==u:
  print(a-1, b)
if t==u:
  print(a, b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
    print(a-1, b)
else:
    print(a, b-1)

Solution (Python):
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U == S:
    print(A-1,B)
else:
    print(A,B-1)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s,t = input().split()
a,b = inpm()
u = input()

if u == s:
    a -= 1
elif u == t:
    b -= 1

print(a,b)

Solution (Python):
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    print(A - (U == S), B - (U == T))


if __name__ == '__main__':
    main()

Solution (Python):
S,T = input().split()
A,B =map(int,input().split())
U = input()
if U==S:
    print(A-1,B)
else:
    print(A,B-1)

Solution (Python):
S,T = input().split()
A,B = input().split()
A = int(A)
B = int(B)
U = input()
if U == S :
    A = A - 1
    print(A,B)
elif U == T :
    B = B - 1
    print(A,B)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if u==s:
  print(a-1,b)
else:
  print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
    print(a-1, b)
else:
    print(a, b-1)

Solution (Python):
dict = {}
S, T = input().split(' ')
dict[S], dict[T] = map(int, input().split(' '))
U = input()
dict[U] -= 1
print(dict[S], dict[T])

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A - 1, B) if (S == U) else print(A, B - 1)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if u==s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    print(a - 1, b)
else:
    print(a, b - 1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u==s:
    print(f"{a-1} {b}")
else:
    print(f"{a} {b-1}")

Solution (Python):


def main():

    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    if U == S:
        A -= 1

    else:
        B -= 1

    print(A, B)


if __name__ == "__main__":
    main()

Solution (Python):
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u==s:
  print(a-1,b)
else:
  print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
    print(str(a - 1) + ' ' + str(b))
else:
    print(str(a) + ' ' + str(b - 1))

Solution (Python):
a,b=input().split()
s,t=list(map(int,input().split()))
u=input()

if a==u:
  print(s-1,t)
elif b==u:
  print(s,t-1)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
print(a-1,b) if s==u else print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
print(a - 1, b) if s == u else print(a, b - 1)

Solution (Python):
S=input().split()
A=list(map(int,input().split()))
U=input()
if U==S[0]:
  print((A[0]-1),A[1])
elif U==S[1]:
  print(A[0],(A[1]-1))

Solution (Python):
def remaining_balls():
    
    S, T = input().split()
    A, B = map(int, input().split())
    U    = input()
    
    if S == U:
        print(A-1, B)
    else:
        print(A, B-1)

remaining_balls()

Solution (Python):
s, t = input().split()
a, b = list(map(int, input().split()))
u = input()
if u == s:
    a -= 1
if u == t:
    b -= 1
print("{} {}".format(a, b))

Solution (Python):
s,t=input().split()
a,b=map(int, input().split())
u=input()

if u==s:
    print(a-1,b)
    
else:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
print(*(a - 1, b) if s == u else (a, b - 1))

Solution (Python):
str = input().split(" ")
S = str[0]
T = str[1]
num = input().split(" ")
NS = int(num[0])
NT = int(num[1])
U = input()

if S == U:
  print(NS - 1, end=" ")
  print(NT)
else:
  print(NS, end=" ")
  print(NT - 1)

Solution (Python):
s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()

if s==u:
    a -= 1
    print(a,b)

else:
    b -= 1
    print(a,b)

Solution (Python):
l1,l2=map(str,input().split(' '))
r,b=map(int,input().split(' '))
find=input()

if find==l1:
    r-=1
else:
    b-=1
print(r,b)

Solution (Python):
S,U = map(str,input().split())
M,N = map(int,input().split())
a = str(input())
if S == a:
  print(M-1,N)
else:
  print(M,N-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == u:
    a -= 1
else:
    b -= 1
print('{} {}'.format(a, b))

Solution (Python):
S,T = input().split()
A,B = map(int, input().split())
U = input()
if U == S: 
    A = A-1
elif  U == T: 
    B = B-1
print(A,B)

Solution (Python):






s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

if (u == s):
    a -= 1
elif (u == t):
    b -= 1

print(a,b)

Solution (Python):
s, t = input().split()
a, b = map(int,input().split())
u = input()

if u == s:
    a -= 1
if u == t:
    b -= 1
print(a, b)

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    S, T = input().split(' ')
    A, B = read_ints()
    U = input()
    if U == S:
        A -= 1
    else:
        B -= 1
    print(A, B)


if __name__ == '__main__':
    solve()

Solution (Python):




















































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S, T = lines[0].split()
    A, B = list(map(int, lines[1].split()))
    U = lines[2]
    
    
    
    
    
    
    
    

    if U == S:
        A -= 1
    else:
        B -= 1

    result = str(A) + ' ' + str(B)

    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['red blue', '3 4', 'red']
        lines_export = ['2 4']
    if pattern == 2:
        lines_input = ['red blue', '5 5', 'blue']
        lines_export = ['5 4']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(3)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()

if s==u:
    print(a-1, b)
else:
    print(a, b-1)

Solution (Python):
s, t = input().split()
a, b =map(int, input().split())
x = input()

if x == s:
  print(a - 1, b)
else:
  print(a, b - 1)

Solution (Python):
s, t = input().split()

a, b = map(int, input().split())

u = input()

if u == s:
    print(a-1,b)

elif u == t:
    print(a,b-1)

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()
print(A-1,B) if S==U else print(A,B-1)

Solution (Python):
s, t = input().split(" ")
a, b = list(map(int, input().split()))
u = input()

if (s == u):
    a -= 1
if (t == u):
    b -= 1
print(str(a) + " " + str(b))

Solution (Python):
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()

if s==u:
    a-=1
elif t==u:
    b-=1
print(a,b)

Solution (Python):
s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if u==s:
    print(a-1,b)
if u==t:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
    a = a-1
elif u == t:
    b = b-1


print(a, b)

Solution (Python):
S , T  = input().split()
A , B =map(int,input().split())
U = input()

mydict = {S:A, T:B}

mydict[U] -= 1
print ( str( mydict[S] ) + " " +str( mydict[T] )  )

Solution (Python):
st = list(input().split())
ab = list(map(int, input().split()))
d = dict(zip(st, ab))
u = input()
d[u] -= 1
print(*list(d.values()))

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S == U:
    A -= 1
else:
    B -= 1

print(A,B)

Solution (Python):
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
    A-=1
elif U==T:
    B-=1
print(A, B)

Solution (Python):
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
L = input().split()
a,b = map(int, input().split())
if input()==L[0]:
  a -= 1
else:
  b -= 1
print(str(a) + ' ' + str(b))

Solution (Python):
import sys
input = sys.stdin.readline

s,t=input().rstrip().split()
a,b=map(int,input().split())
u=input().rstrip()

if u == s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
r = input()
if r == s:
  print(a-1, b)
else:
  print(a, b-1)

Solution (Python):
def solve():
  S, T = input().split()
  ans = list(map(int, input().split()))
  U = input()
  if U==S:
    ans[0] -= 1
  else:
    ans[1] -= 1
  return ans
print(*solve())

Solution (Python):



S, T = input().split()
A, B = map(int, input().split())
U = input()


if U==S:
    A -= 1
else:
    B -= 1


print(A, B)

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U = input()

if U==S:
    print(A-1, B)
    exit()
print(A,B-1)

Solution (Python):
s, t = input().split()
a, b = map(int,input().split())
U = input()
d = {s: a, t: b}
if U == s:
    print(a - 1, b)
else:
    print(a, b - 1)

Solution (Python):




s, t = input().split()
a, b = map(int,input().split())
u = input()

aa = a
ab = b


if s == u:
    aa = aa - 1
elif t == u:
    ab = ab - 1


print(aa, ab)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

ss, st = ins().split()
a, b = inm()
su = ins()


def solve():
    if su == ss:
        return (a - 1), b
    else:
        return a, (b - 1)


print(*solve())

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U = input().strip()
if S==U:
    print(A-1,B)
else:
    print(A,B-1)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
dic = defaultdict(int)
s,t = input().split()
a,b = readInts()
dic[s] = a
dic[t] = b
u = input()
dic[u] -= 1
print(dic[s], dic[t])

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()
if s==u: print(a-1,b)
elif t==u: print(a,b-1)
else: print(a,b)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1 if S==U else A)
print(B if S==U else B-1)

Solution (Python):
import sys
S,T = input().split()
A,B = map(int,input().split())
U = input()

if not ( S.islower() and T.islower() and U.islower() ): sys.exit()
if not ( 1 <= len(S) <= 10 and 1 <= len(T) <= 10 ): sys.exit()
if not ( S != T ): sys.exit()
if not ( S == U or T == U ): sys.exit()
if not ( isinstance(A,int) and isinstance(B,int) ): sys.exit()

print(A-1,B,sep=' ') if U == S else print(A,B-1,sep=' ')

Solution (Python):

import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    s, t = input().split()
    a, b = MI()
    u = input()

    if s == u:
        a -= 1
    else:
        b -= 1
    print(a, b)


main()

Solution (Python):
s,t=input().split();a,b=map(int,input().split())
print(a,b-1) if t==input() else print(a-1,b)

Solution (Python):
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
    print(a-1,b)
else:
    print(a,b-1)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if(u==s):a-=1
else: b-=1
print(a,b)

Solution (Python):

import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../atcoder/input.txt'))
	sys.stdin = open(name)

l = list(map(str,input().split()))
a,b = map(int,input().split())
check = input()

if check == l[0]:
    a -= 1
else:
    b -= 1

print(a,b)

Solution (Python):
s, t = input().split()
a, b = [int(i) for i in input().split()]
u = input()
if s == u:
  a -= 1
else:
  b -= 1
print(a, b)

Solution (Python):
ST = input().split()
AB = list(map(int, input().split()))
U = input()
AB[ST.index(U)] -= 1
print(*AB)

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

p = L()
a,b = I()
u = s()
if u == p[0]:
    a -=1
else:
    b-=1

print("{} {}".format(a,b))

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()
if s==u:
    a=a-1
else:
    b=b-1
print(a,b)

Solution (Python):
A,B=input().split()
a,b=map(int,input().split())
s=input()
if s==A: print(a-1,b)
else: print(a,b-1)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())



br = LS()
AB = LI()
U = _S()

def main():
    brAB = zip(br, AB)
    tmp=[]
    for c,n in brAB:
        if c==U:
            tmp.append(n - 1)
        else:
            tmp.append(n)
    return str(tmp[0])+' '+str(tmp[1])
print(main())

Solution (Python):
s,t = list(map(str,input().split()))
a,b = list(map(int,input().split()))
u = str(input())

if s == u:
  print(a - 1,b)
elif t == u:
  print(a,b - 1)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A - (S == U), B - (T == U))

Solution (Python):
s, t = input().split()
a, b = map( int, input().split() )
u = input()

if s == u:
    print( a - 1, b )
else:
    print( a, b - 1 )

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()

if S==U:
	print(A-1,B)
elif T==U:
	print(A,B-1)

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()

if u == s:
  a = a - 1
if u == t:
  b = b - 1

print(a,b)

Solution (Python):
S, T = "red", "blue"
A, B = 3, 4
U = "red"

S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()


def calculate(s, t, a, b, u):
    if u == s:
        print("{} {}".format((a - 1), b))
    else:
        print("{} {}".format(a, (b - 1)))


calculate(S, T, A, B, U)

Solution (Python):
s,t = input().split()
a,b = map(int,input().split())
u = input()

if(s==u):
    a -= 1
else:
    b -= 1

print(a,b)

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(A-1,B)
else:
  print(A,B-1)

Solution (Python):
ST = input().split()
A, B = list(map(int, input().split()))
U = input()
idx = ST.index(U)
if idx == 0:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):
s,t = input().split()
a,b = map(int, input().split())
u = input()
if(u == s):
  a = a-1
else:
  b = b-1

print(str(a) + " " + str(b))

Solution (Python):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
else:
    B -= 1

print(A, B)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
    print(a - 1, b)
else:
    print(a, b - 1)

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    print("{} {}".format(a-1,b))
else:
    print("{} {}".format(a,b-1))

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
    a = a-1
elif u == t:
    b = b-1
    
print(str(a) + ' ' + str(b))

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(str(A-1)+" "+str(B))
else:
  print(str(A)+" "+str(B-1))

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
    a -= 1
else:
    b -= 1
print(a, b)

Solution (Python):
S,T=map(str,input().split())
a,b=map(int,input().split())
U=input()
if U == S:
  a +=-1
elif U == T:
  b += -1
print(a,b)

Solution (Python):
st = input().split()
ab = map(int, input().split())
rb = input()

di = dict(zip(st, ab))
di[rb] -= 1
print(*list(di.values()))

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
d = dict(zip([S, T], [A, B]))
U = input()
d[U] -= 1
print(*d.values())

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U = input()

if S==U:
	print(A-1,B)
elif T==U:
	print(A,B-1)

Solution (Python):
s,t = map(str, input().split())
a,b = map(int, input().split())
if input() == s:
	a -= 1
else:
	b -= 1
print(a, b)

Solution (Python):
def main():
 s,t = input().split()
 a,b = map(int,input().split())
 u = input()
 if s == u:
     a -= 1
 else:
     b -= 1
 print(a,b)
main()

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
print(A-1, B) if input()==S else print(A, B-1)

Solution (Python):
color=input().split()
number = list(map(int, input().split()))
c = input()
for i in range(2):
  if c == color[i]: number[i] -= 1
number = list(map(str, number))
print(' '.join(number))

Solution (Python):
s, t = input().split()
d = {}
d[s] , d[t] = map(int, input().split())
d[input()]-=1
for i in d.values(): print(i, end = ' ')

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()

if S==U:
    A-=1
else:
    B-=1

print(A,B)

Solution (Python):
def main():
    str1, str2 = input().rstrip().split(' ')
    str1_quantity, str2_quantity = (int(i) for i in input().rstrip().split(' '))
    chosen_ball_str = input().rstrip()

    if str1 == chosen_ball_str:
        str1_quantity -= 1
    else:
        str2_quantity -= 1
    print('{} {}'.format(str1_quantity, str2_quantity))


if __name__ == '__main__':
    main()

Solution (Python):
s,t = map(str,input().split())
a,b = map(int,input().split())
u=input()
if u==s:
  print(a-1,b)
else:
  print(a,b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

bnum = {s: a, t: b}
bnum[u] -= 1
print('{} {}'.format(bnum[s], bnum[t]))

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
dict={s:a,t:b}
if s==u:
  dict[s]-=1
else:
  dict[t]-=1
print(dict[s],dict[t])

Solution (Python):
S,T=map(str, input().split())
A,B=map(int, input().split())
U=str(input())
if S==U:
    print(A-1,B)
elif T==U:
      print(A,B-1)

Solution (Python):
S,T=map(str, input().split())
a,b=map(int, input().split())
U = str(input())

if S == U :
    a -= 1
if T == U:
    b -= 1
print(a,b)

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U   = input()

if S == U:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):
s, t = input().split()

a, b = map(int,input().split())
u = input()

if u == s:
    a -= 1
else:
    b -= 1
print(a, b)

Solution (Python):
r, b = input().split()

a, b = map(int, input().split())

u = input()

if r == u:
  print(a-1, b)
else:
  print(a, b-1)

Solution (Python):
s,t = input().split()
a,b = map(int,input().split())
u = input()
if s == u:
    a -= 1
if t == u:
    b -= 1
print(a,b)

Solution (Python):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

if S==U:
  A -= 1
if T==U:
  B -= 1

print(f'{A} {B}')

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
    a -= 1
else:
    b -= 1
print(a, b)

Solution (Python):
s, t = list(input().split())
a, b = list(map(int, input().split()))
u = input()
if u==s:
	a-=1
elif u==t:
	b-=1
print(a,b)

Solution (Python):
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
    print(str(a - 1) + " " + str(b))
else:
    print(str(a) + " " + str(b - 1))

Solution (Python):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(str(A-1)+" "+str(B))
else:
  print(str(A)+" "+str(B-1))

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S == U:
  A -= 1
else:
  B -= 1
  
print(A, B)

Solution (Python):
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()

if S == U:
  A -= 1
else:
  B -= 1
print(A,B)

Solution (Python):
S,T=map(str, input().split())
A,B=map(int, input().split())
U=input()
if U == S:
    print(f'{A-1} {B}')
else:
    print(f'{A} {B-1}')

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if (s == u):
    print(a-1, b)
elif (t == u):
    print(a, b-1)

Solution (Python):
s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
  print(a - 1, b)
else:
  print(a, b - 1)

Solution (Python):
S,T = input().split()
A,B = map(int,input().split())
U = input()

if S==U:
  print("{0} {1}".format(A-1,B))
else:
  print("{0} {1}".format(A,B-1))

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    S,T = LS()
    A,B = LI()
    U = _S()
    print("{} {}".format(A-1,B) if U==S else "{} {}".format(A,B-1))

main()

Solution (Python):
S,T = input().split()
a,b = map(int,input().split())
U = input()




if S == U:
    print(a-1,b)
elif T == U:
    print(a,b-1)
else:
    pass

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())
u=input()
if u==s:
  a-=1
else:
  b-=1
print(a,b)

Solution (Python):
S, T = map(str,input().split())
A, B = map(int,input().split())
U = input()

if S == U:
    A -= 1
else:
    B -= 1

print("{} {}".format(A,B))

Solution (Python):
s,t=input().split()
a,b=map(int,input().split())

u=input()

if u==s:
    print("{} {}".format(a-1,b))
elif u==t:
    print("{} {}".format(a,b-1))

Solution (Python):
a,b = input().split()
c,d = map(int,input().split())
e = input()

if a == e:
  print("{} {}".format(c-1,d))
else:
  print("{} {}".format(c,d-1))

Solution (Python):

import sys, re
from decimal import *
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor, trunc, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a,b = map(str, input().split())

u,v = MAP()

z = input()

if(z==a):
    print(u-1, v)
else:
    print(u, v-1)

Solution (Python):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if U == S:
    print(A - 1, B)
else:
    print(A, B - 1)

Solution (Python):
S, T = input().split()
A, B = map(int,input().split())
U = input()

if U == S:
  A -= 1
else:
  B -= 1

print(A, B)

Solution (Python):
(s, t), (n, m), q = input().split(), map(int, input().split()), input()
print(f'{n} {m - 1}' if q == t else f'{n - 1} {m}')

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S :
    A-=1
else :
    B-=1

print("{} {}".format(A, B))

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S==U:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):
s,t=list(input().split())
a,b=list(map(int,input().split()))
u=input()
ball={s:a,t:b}  
ball[u] =max(0,ball[u]-1)

print(ball[s],ball[t])

Solution (Python):
S,T = input().split()
A,B = list(map(int,input().split()))
U = input()

if S == U:
    A -= 1
if T == U:
    B -= 1
print(A,B)

Solution (Python):
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())

if S == U:
    A -= 1
    print(A,B)

elif T == U:
    B -= 1
    print(A,B)

Solution (Python):
a, b = map(str, input().split())
c, d = map(int, input().split())
e = str(input())
if e==a:
    print(c-1, d)
elif e==b:
    print(c, d-1)

Solution (Python):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):

if __name__ == '__main__':

	tmp0 = input().split()
	tmp1 = map(int,input().split())
	tmp2 = input()

	dic = {}

	for x,y in zip(tmp0,tmp1):
		dic[x] = y

	dic[tmp2] = dic[tmp2] - 1

	print(*dic.values())

Solution (Python):
lis=list(input().split())
num=list(map(int,input().split()))
num[lis.index(input())]-=1
print(str(num[0])+" "+str(num[1]))

Solution (Python):
s = list(input().split())
a, b = list(map(int, input().split()))
z = input()
k = a - 1
m = b - 1
if s[0] == z:
	print(k, end=' ')
	print(b)
elif s[1] == z:
	print(a, end=' ')
	print(m)