peterverebics/CodeNet_Python_118 huggingface dataset:
A = input()
a,b = (A.split(' '))
B = input()
c,d = (B.split(' '))
e = int(c)
f = int(d)
C = input()

if A == C:
    print('{} {}'.format(e-1,f))
else:
    print('{} {}'.format(e,f-1))
S, T=map(str, input().split())
A, B=map(int, input().split())
U=input()
if S==U:
  print(str(A-1)+' '+str(B))
elif T==U:
  print(str(S)+' '+str(B-1))
colors = list(map(str, input().split()))
numbers = list(map(int, input().split()))
target_color = input()

dictionary = {}
for index, color in enumerate(colors):
  dictionary[color] = numbers[index]
 
for color in dictionary.keys():
  print(str(dictionary[color]) + " ", end="")
fs, bs = map(str,input().split())
ci, di = map(int,input().split())
es = str(input())

if es == fs:
  ca = ci - 1
  print(ca)
elif es == bs:
  da = di -1
  print(da)
S,T = input().split()
A,B = map(int,input().split())
U = input().strip()
if U==S:
    print(A-1)
else:
    print(B-1)
s = input()

s_len = len(s)
result = ''
while True:
    result += 'x'
    if len(result) == s_len:
        break

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

if u == s:
    print(int(a)-1,b)
else:
    print(a,int(b)-1)
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u == 'red':
    print(a - 1, b)
else:
    print(a, b - 1)
a,b = input().split()
c,d = map(int,input().split())
t=input()
print(c-1 if t==a else a,d-1 if t==b else d)
s,t = map(str,input().split())
a,b = map(int,input().split())
u =map(str,input().split())

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

if s == u:
  a -= a
else:
  b -=b

print(a, b, sep='\t')
S,T=input().split()
A,B=map(int,input().split())
U=input()
dic={S:A,T:B}
dic[U]-=1
for v in dic.values():
    print(v,end=' ')
a = dict(
  zip(
    list(input().split()),
    list(map(int, input().split()))
  )
)
U = input()
a[U] = a[U]-1

print(*list(a.values()))
s, t = list(map(str, input().split()))
a, b = list(map(int, input().split()))
u = input()

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

if u == 'red':
    a -= 1
else:
    b -= 1

print(a, b)
colors = input("Color: ").split()
numbers = list(map(int, input("Number: ").split()))
picked_color = input("Pick: ")

dic = dict(zip(colors, numbers))
ans = ""

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans = ans + str(number) + " "
        
print(ans.rstrip())
s,t = map(str, input().split())
a,b = map(int, input().split())
u = str(input())
if s == "red" and u == "red":
  print(a-1 , b)
elif s == "red" and u == "blue":
  print(a , b-1)
elif t == "blue" and u == "red" :
  print(a-1 , b)
elif t == "blue" and u == "blue" :
  print(a, b-1)
S,T=map(str,input().split())
A,B=map(int,input().split())
U=input()
if U=='red':
    print(A-1,'',B)
else:
    print(A,'',B-1)
s, t = map(str, input().split())
a, b = map(int, input().split())
u = str(input())

if u==s:
    print('{}, {}' .format(a-1, b))
else:
    print('{}, {}'.format(a, b-1))
s, t = list(input().split())
s_num, t_num = map(int, input().split())
bad_string = input()

if bad_string == s:
    print(s_num - 1, t_num)
elif bad_string == t_num:
    print(s_num, t_num - 1)
else:
    print(s_num, t_num)
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1, B if S==U else A, B-1)
list1 = input()
list1 = list1.split(' ')
list2 = input()
list2 = list2.split(' ')
list3 = input()
S = list1[0]
T = list1[1]
lenS = int(list2[0])
lenT = int(list2[1])
select = list3[0]
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)
D={s:x for s,x in zip(input().split(),list(map(int,input().split())))};D[input()]-=1;[print(D[s],end=" ")for s in D]
a = list(map(str, input().split()))
b = list(map(int, input().split()))
c = list(map(str, input().split()))
if a[0] == c:
	b[0] = b[0] - 1
else: b[1] = b[1] -1
print(b[0],b[1])
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()
    if U == "red":
        print(str(A - 1) + " " + str(B))
    else:
        print(str(A) + " " + str(B - 1))

main()
a,b=input().split()
ST={}
ST[a], ST[b] = map(int, input().split())
ST[input()]-=1

for k,v in ST.items():
  print(v,end='')
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)
def main():

    s,t = map(str, input().split())

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

    u = str(input())

    if u == 'red':
        print(str(a-1), str(b))
    elif u == 'blue':
        print(str(a), str(b-1))

if __name__ == '__main__':
    main()
s,t=map(str,input().split())
a,b=map(int,input().split())
u=str(input())

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

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

print(a, b)
S = input()
T = input()

A = len(S)
B = len(T)

U = input()

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

print(A, B)
a = list(map(str,input().split()))
b = list(map(int,input().split()))
c = input()

b[a.index(c)] -= 1

print(b)
S, T = int, input().split()
A, B = map(int, input().split())
U = input()
ans = [A, B]
if U == S:
    ans[0] = A - 1
else:
    ans[1] = B - 1
print(" ".join(map(str, ans)))
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A-1, B if S ==U else A, B-1)
s,t=input().split()
a,b=map(int,input().split())
u=input()
print(str(a-1)+" "+str(b) if len(s)==len(u) else str(a)+" "+str(b-1))
# 154

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

if len(U) == len(S):
    A -= 1
else:
    B -= 1
print(A,B)
name  = list(map(str, input().split()))
number=list(map(int, input().split()))
dash  =input()
if name[0] == dash:
   number[0]=number[0]-1
print(number)
s, t = input().split()
a, b = map(int, input().split())
u = input().split()

if s == u:
  print(a-1, b)
else:
  print(a, b-1)
a, b=map(str,input().split())
c, d=map(int,input().split())
e=str,input()
if e==a:
  print(c-1,d)
else:
  print(c,d-1)
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input().split()
 
    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(str(A) + " " + str(B))
 
if __name__ == "__main__":
    resolve()
s=input()
ans=str()
for i in range(len(s)):
    ans+="x"
target_a, target_b = list(map(str, input().split()))
a, b = map(int, input().split())
target = input('')
list_target_a = list(target_a)
list_target_b = list(target_b)
list_target = list(target)

if len(list_target) == len(list_target_a):
    a -= 1
if len(list_target) == len(list_target_b):
    b -= 1

print(a, b)
s,t=list(map(str,input().split()))
a,b=list(map(int,input().split()))
u=list(map(str,input().split()))
if s != t:
    if u == s:
        a = a-1
    else:
        b = b-1
print(a,'',b)
S = input()
char_list = list(S)
new_list=[]
for char  in char_list:
    char = "x"
    new_list.append(char)
output = "".join(new_list)
print(output)
[S, T] = [x for x in input().split()]
[A, B] = [int(x) for x in input().split()]
U = input()

if U == S:
    A -= 1
else:
    B -= 1
print([A,B])
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U  == S:
    print(B)
else:
    print(A)
import sys
readline = sys.stdin.readline
s, t = readline().split()
a, b = map(int, readline().split())
if s == readline():
  print(a-1,b)
else:
  print(a,b-1)
# -*- coding: utf-8 -*-

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

#処理
if S == U:
    print(B)
else:
    print(A)
items = {}
colors = input().split(" ")
nums = input().split(" ")
remove = input()

for i in range(len(colors)):
    items[colors[i]] = int(nums[i] )

items[remove] -= 1

for x in items.keys():
    print(x + " ", end="")
[N, T] = list(map(str, input().split()))
[A, B] = list(map(int, input().split()))
U = input()
print(N, T, A, B, U)
if (N == U):
    A -= 1
else:
    B -= 1
print("{} {}".format(A, B))
def main():

    s,t = map(str, input().split())

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

    u = str(input())

    if u == 'red':
        print(str(a-1), str(b))
    else:
        print(str(a), str(b-1))

if __name__ == '__main__':
    main()
S,T = map(str,input().split())
X,Y = map(int,input().split())
Z = input()
if S==Z or T==Z:
    print(X+Y-1)
else:
    print(X+Y)
S, T = input().split()
A, B = map(int,input().split())
U = input()

result_dict = {S: A, T: B}
result_dict[U] -= 1
print(" ".join(map(str, result_dict.values())))
S,T = input().split()
A,B = map(int,input().split())
U = input()
print((A-1,B) if S == U else (A,B-1))
a,b=map(str,input().split())
c,d=map(int,input().split())
hashe={a:c,b:d}
e=input()
hashe[e]-=1
print(*hashe.values())
#a
s,t = input().split()
a,b = map(int,input().split())
u = input()

if u == s:
    print(a,b-1)
else:
    print(a-1,b)
colors = input().split()
numbers = list(map(int, input().split()))
picked_color = input()

dic = dict(zip(colors, numbers))
ans = ""

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans = ans + str(number) + " "
        
print(ans.strip())
S, T = input().split()
A, B = map(int, input().split())
U = input()

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

print(A, B)
import sys
input = sys.stdin.readline

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


if S == U:
    print(A, B-1)
else:
    print(A-1, B)
S, T = input().split()
A, B = map(int, input().split())
U = input()
 
if S == U :
  print(A - 1)
elif T == U :
  print(B - 1)
tmp = input().split()
S = tmp[0]
T = tmp[1]
i = list(map(int, input().split()))
A = i[0]
B = i[1]
U = input()

if S == U:
  print(str(A-1) + " " + str(B))
else:
  print(str(A) + " " + str(B))
from sys import stdin


def get_result(data):
    return 'x' * len(data)

if __name__ == '__main__':
    data = input()
    result = get_result(data)
    print(result)
name = input().split()
n1 = name[0]; n2 = name[1]
lnum = input().split()
lnum1 = int(lnum[0]); lnum2 = int(lnum[1])
l1 = [n1, lnum1]
l2 = [n2, lnum2]
choosen = input()
print(l1)
print(l2)

if choosen == n1:
    print(l1[1]-1, end=" ")
    print(l2[1])
if choosen == n2:
    print(l1[1], end=" ")
    print(l2[1]-1)
print("enter S and T value")
S, T = input().split()
print("enter A and B value")
A, B = map(int, input().split())
print("enter U value")
U = input()
if S==U:
  print("{} {}".format(A-1,B))
elif T==U:
  print("{} {}".format(A,B-1))
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
  a -= 1
if t == s:
  b -= 1
print(a, b)
a=input()
import re
result=re.sub(r'[a-z]', "x", a)
print(result)
S,T = input().split()
A,B = map(int,input().split())
U = input()
print((A-1),B if S == U else A,(B-1))
S, T = input().split()
A, B = map(int,input().split())
U = input()

dic = {}
dic[S] = A
dic[T] = B

dic[U] -= 1

for key in dic.keys():
    print(dic[key],end='')
    print(' ',end='')
# cook your dish here
N,K = map(str, input().split())
r , b = map(int, input().split())
p = input()
if p == "red":
    print(r-1,b)
    exit()
if p=="blue":
    print(r,b-1)
    exit()
def main():
    s,t = list(input().split())
    a,b = map(int,input().split())
    ss = input()

    if ss == s:
        print(str(a-1) + ' ' + str(b))
        return
    else:
        print(str(a) + ' ' + str(b))
if __name__=='__main__':
    main()
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

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

if U == "red":
    A -= 1
else:
    B -= 1

print(A, B)
# a = list(map(int, input().split()))
# N = int(input())

s, t = input().split()
a, b = list(map(int, input().split()))
string = input()
if string == "red":
    print(a-1, b)
else:
    print(a, b-1)
s,t=(str,input().split())
a,b=(int,input().split())
u=str(input())

if s==u:
  print (a-1,b)
if t==u:
  print(a,b-1)
import sys
input = sys.stdin.readline
 
S, T = input().split()
A, B = map(int, input().split())
U = input()
 
if S==U:
  print(A-1,B)
else:
  print(A,B-1)
s, t = input().split()
a, b = map(int, input().split())
u = input()

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

print(a, b)
n = input()
(s,t) = n.split()
m = input()
(a,b)=m.split()
k = input()
if k is  s:
    a_1 = int(a) - 1
    print(str(a_1)+' '+ b)
else:
    b_1 = int(b) -1
    print(a +' '+str( b_1))
s, t = input().split()
a, b = map(int, input().split())
u = input().split()

if s == u:
  print(a-1, b)
elif t == u:
  print(a, b-1)
else:
  print(a, b)
s, t= input().split(' ')
a, b = map(int,input().split(' '))
u = input()
print(a-1) if u == s else print(b-1)
S = input().split()
A = list(map(int, input().split()))
Z = input()

if S[0] == Z:
  X = A[1]
  Y = A[0] - 1
if S[1] == Z:
  X = A[0]
  Y = A[1]-1
  
print("{} {}".format(X, Y))
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A - 1, B) if "red" == U else print(A, B - 1)
L = input().split()
S = L[0]
T = L[0]
a,b = map(int, input().split())
U = input()
if U == S:
  a = a-1
elif U == T:
  b = b -1

print(a, b)
s = list(input().split())
a = list(map(int, input().split()))
a[s.index(input())] -= 1
for i in a:
  print(i, end = '')
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A)
S,T = map(str,input().split())
A,B = map(int,input().split())
U = str(input())

if U == "red":
    print(A-1,B)
else:
    print(A,B-1)
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input().split()
 
    if S == U:
        A = A - 1
    else:
        B = B - 1
 
    print(A, B)
 
if __name__ == "__main__":
    resolve()
items = {}
colors = input().split(" ")
nums = input().split(" ")
remove = input()

for i in range(len(colors)):
    items[colors[i]] = int(nums[i] )

items[remove] -= 1

for x in items.keys():
    print(str(items[x]) + " ", end="")
S, T = input().split()
A, B = map(int, input().split())
U = input()

ans = A + B

if S == U or T == U:
    ans -= 1

print(ans)
import sys

def main():
    k = input().replace('\n','').split()
    a = input().replace('\n','').split()
    u = input().replace('\n','')
    a[k.index(u)]=int(a[k.index(u)]) - 1
    print(a[0],a[1])
if __name__ == '__main__':
    input = sys.stdin.readline
    main()
S, T =str, input().split()
A, B =map(int, input().split())
U = input()

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

print(A, B)
s, t = input().split()
a, b = map(int, input().split())
u = input()
print(a-1 if u == s else b-1)
input1 = input()
s = str(input1).split(' ')[0]
t = str(input1).split(' ')[1]
input2 = input()
a = int(str(input2).split(' ')[0])
b = int(str(input2).split(' ')[1])
u = str(input())
if s == t:
  a = a - 1
else:
  b = b - 1
print(a, ' ', b)
moji = list(map(str,input().split()))
kazu = list(map(int,input().split()))
U = input()
print(kazu[moji.index(U)] -1)
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

balls = {s:a, t:b}

for key in balls:
    if key == u:
        balls[key] = balls[key] - 1
        
listBalls = list(balls.values())
print(listBalls[0], listBalls[1])
s, t = input().split()
a, b = map(int, input().split())
u = input()
if u == s:
  a -= 1
if u == s:
  b -= 1
print(a, b)
s,t = map(str, input().split())
a,b = map(int, input().split())
u = str(input())
if s == "red" and u == "red":
  print(a-1 , b)
elif s == "blue" and u == "red" :
  print(a , b-1)
elif s == "red" and u == "blue":
  print(a , b-1)
elif s == "blue" and u == "blue" :
  print(a-1 , b)
elif t == "red" and u == "red":
  print(a , b-1)
elif t == "blue" and u == "red" :
  print(a-1 , b)
elif t == "red" and u == "blue":
  print(a-1 , b)
elif t == "blue" and u == "blue" :
  print(a , b-1)
S=input()
m="S"
n=len(m)
print("x"*7)
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input(str)
if S == U:
  print(A-1),
  print(B),
else:
  print(A),
  print(B-1),
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([str(a)+" "+str(b)])
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()
print(a-1 if s == u else b-1)
s,t=map(str,input().split())
a,b=map(int,input().split())
u=str(input())
print(a-1,b if u==s else a,b-1)
from collections import defaultdict
d = defaultdict(int)
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
d[s] = a
d[t] = b
d[u] -= 1
values = list(d.values())
print(values[0], values[1])
s, t = map(str, input().split())
a, b = map(int, input().split())
u = str(input())
if u == s:
    a = a-1
else :
    b = b-1
    
print("{} {}".format(s, t))
print("{} {}".format(a,b))
S,T = list(input().split())
A,B = list(map(int,input().split()))
U = input()

if S==U:
    A-=1
elif S==T:
    B-=1
print(A,B)
N,M = map(str,input().split())
NN,MM = map(int,input().split())
ress = input()
if(ress == N):
  NN = NN-1
elif(ress == M):
  MM == MM-1
print(NN,MM)
S, T = map(str, 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)
s=list(input().split())
a,b=map(int,input().split())
print(a,b-1 if s.index(input())==1 else a-1,b)
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(S)
print(U)
if S == U:
    print(A-1, B)
else:
    print(A, B-1)
l = {}
s, t = input().split()
a, b = map(int, input().split())
u = input()
print(a, b-1) if s==u else print(a-1, b)
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()
 
    print(U)

    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(str(A) + " " + str(B))
 
if __name__ == "__main__":
    resolve()
s = input().split()
num = [int(i) for i in input().split()]
u = input()
num1 = num[0]
num2 = num[1]

if s[0] == u:
    nums = num1 - 1
    print("{} {}".format(nums, num1))
elif s[1] == u:
    nums = num2 - 1
    print("{} {}".format(num1, nums))
s, t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
  print(b)
else:
  print(a)
S,T=map(list,input().split())
A,B=map(int,input().split())
U=(input())
if A >0 and U=="red":
  print(A-1,B)
elif B>0 and U=="blue":
  print(A,B-1)
elif A==0 and U=="red":
  print(0,B)
elif B==0 and U=="blue":
  print(A,0)
colors = input("Color: ").split()
numbers = list(map(int, input("Number: ").split()))
picked_color = input("Pick: ")

dic = dict(zip(colors, numbers))
ans = list()

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans.append(number)
        
print(' '.join(str(n) for n in ans))
S, T = input().split()
A, B = map(int, input().split())
U = input()

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

if U=="red":
  print(A-1, B) 
else:
  print(A,B-1)
from collections import defaultdict
d = defaultdict(int)
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
d[s] = a
d[t] = b
d[u] -= 1
for v in d.values():
  print(v, end=' ')
S = input()
T = input()
A = len(S)
B = len(T)
U = input()
if U==S:
    A -= 1
if U == T :
    B -= 1
print(A," ",B)
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == T:
    A = A-1
else:
    B = B-1
print(A, B)
list1 = input()
list2 = input()
list3 = input()
list1 = list1.split(' ')
list2 = list2.split(' ')
S = list1[0]
T = list1[1]
lenS = int(list2[0])
lenT = int(list2[1])
select = list3[0]
if select == S:
    lenS -= 1
elif select == T:
    lenT -= 1
print(lenS,lenT)
a,b=input().split()
c,d=input().split()
e=input()
c=int(c)
d=int(d)
if a==e:
  print(c-1)
else:
  print(d-1)
import sys

def main():

    # sys.stdin = open("input154a.txt")

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

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

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

if __name__ == "__main__":
    main()
s, t = input().split()
a, b = list(map(int, input().split()))
u = input()
if u == 'red':
    print(a-1, b)
else:
    print(a, b-1)
a,b = input().split()
A,B = input().split()
c = input()
a = str(a)
b = str(b)
A = int(A)
B = int(B)
c = str(c)
d = A - 1
D = B - 1
if c == a:
    print(d)
elif c == b:
    print(D)
S, T = input().split()
A, B = list(map(int, input().split()))
U = input()

if U == 'red':
    A -= 1
else:
    B -= 1
    
print(A, B)
M = [input() for i in range(3)]
M[0] = M[0].split()
s = str(M[0][0])
t = str(M[0][1])

M[1] = M[1].split()
a = int(M[1][0])
b = int(M[1][0])

U = str(M[2])

if s == U:
  a -= 1
else:
  b -= 1

print(str(a) + ' ' + str(b))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

def main():
    N, *A = read().split()
    for a in A:
        if A.count(a)==1:
            continue
        else:
            result = 'NO'
            return result
    else:
        result = 'Yes'
    return result

if __name__ == '__main__':
    print(main())
S, T = input().split()
A, B = map(int, input().split())
U = input()

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

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

if U == 'red':
    A -= 1
else:
    B -= 1

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

if u == "red":
    print(a - 1, b)
else:
    print(a, b - 1)
s,t=input().split()
a,b=map(int,input().split())
u=input()
print(a-1,b if s==u else a,b-1)
S,T=input().split()
A,B=map(int,input().split())
U=input()

if "S"=="U":
  print(A-1,B)
else:
  print(A,B-1)
S = "red"
T = "blue"
A ,B = input().split()
U = str(input())
if(U == S):
   A = int(A) - 1
elif(U==T):
    B = int(B) -1
print(A, B)
s,t=list(input().split())
a,b=list(map(int,input().split()))
u=input()
 
if u==s:
  print(a-1)
else:
  print(b-1)
import sys
from pprint import pprint

def solve(s, t, a, b, u):
    if u == "red":
        a -= 1
    if u == "blue":
        b -= 1
    print(a, b)

if __name__ == '__main__':
    s, t = sys.stdin.readline().strip().split(" ")
    a, b = map(int, sys.stdin.readline().strip().split(" "))
    u = sys.stdin.readline().strip()
    solve(s, t, a, b, u)
s=input()
ans=''
for _ in s:
  ans+='x'
print(ans)
args = input().split()
S = args[0]
T = args[1]

args2 = input().split()
a = int(args2[0])
b = int(args2[1])

U = input()

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

if input()=="red":
  print(A-1,B)
else:
  print(A,B-1)
w1, w2 = input().split()
a, b = [int(i) for i in input().split()]
d = {w1: a, w2: b}

d[input()] -= 1

print(*d.values())
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())

h1 = {}
h1[s] = a
h1[t] = b

h1[u] = h1[u] - 1

ans = ''
for key, value in h1.items():
    ans = ans + str(value) + ' '

ans = ans[:-1]
print(ans)
a, b = input().split()
c, d = map(int, input().split())
e = input()
if a == e:
    print("{} {}".format(c-1,d))
if b == e:
    print("{} {}".format(c-1,d))
a,b=map(str,input().split())
c,d=map(int,input().split())
hashed={a:c,b:d}
e=input()
hashed[e]-=1
print(*hashed.values())
S=input()
word="S"
print(word.replace("S","X")*len(S))
l=input().split()
for i in l:
  if l.count(i)!=1:
    print("NO")
    exit(0)
print("YES")
S, T =map(str, input().split())
A, B =map(int, input().split())
U = input()

if U == "red":
    A -= 1
else:
    B -= 1

print(A, B)
N_dict  = {i:0 for i in list(map(str,input().split()))}
N_List = list(map(int,input().split()))
ct = 0
for i in N_dict.keys():
    N_dict[i] = N_List[0]
    ct += 1
print(N_dict[str(input())]-1)
s, t = input().split()
a,b = map(int,input().split())
u = input()

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

else:
	print(b-1)
w = input().split()
print(w)
l = [int(i) for i in input().split()]
l[w.index(input())] -= 1
print(*l)
# coding: utf-8
s,t = input().split()
a,b = map(int, input().split())
u = input()

if u == s:
    print(a-1)
else:
    print(b-1)
s,t = input().split()
a,b= map(int,input().split())
u = input()
if u in s:
    print(a-1)
if u in t:
    print(b-1)
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))