peterverebics/CodeNet_Python_118 huggingface dataset:
s,t=map(str,input().split())
a,b=map(int,input().split())
ss=input()
if ss=="s":
  a-=1
else:
  b-=1
print(a,b)
S, T = input().split()
A, B = map(int, input().split())
if S == input():
  A -=1
else:
  B -=1
print("{0}" "{1}".format(A, B))
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))
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
s,t = [i.rstrip() for i in readline().split()]
a,b = [int(i) for i in readline().split()]
u = readline()

if u == s:
    print(a-1, b)
else:
    print(a, b-1)
from sys import stdin

s, t = stdin.readline().rstrip().split()
a, b = [int(x) for x in stdin.readline().rstrip().split()]
u = stdin.readline().rstrip().split()

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


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

print(C)
print(S,T,A,B,U)
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
    print(len(S)-1,len(T))
else:
    print(len(S),len(T)-1)
a,b=input().split()
c,d=map(int,input().split())
print(c-1 if input()==a else d-1)
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()
if choosen == n1:
    print(l1[1]-1, end=" ")
    print(l2[1])
if choosen == n2:
    print(l2[1]-1, end="")
    print(l1[1])
S, T = input().split()

A, B = [int(i) for i in input().split()]

U = input().split()

if U == S :
    A = A - 1
else :
    B = B - 1
    
print(A, B)
import sys
s, t = map(str, sys.stdin.readline().split())
a, b = map(int, sys.stdin.readline().split())
u = sys.stdin.readline()
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 = str(input())
if s == "red" and u == "red":
  print(a-1 , b)
elif s == "blue" and u == "red" :
  print(b-1 , a)
elif s == "red" and u == "blue":
  print(b-1 , a)
elif s == "blue" and u == "blue" :
  print(a-1 , b)
elif t == "red" and u == "red":
  print(b-1 , a)
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(b-1 , a)
a, b = input().split()
na, nb = map(int, input().split())
c = input()
if c == "red":
  print(na - 1, nb)
else:
  print(na, nb - 1)
s,t=input().split()
a,b=map(int,input().split())
u=input()
if u == t:
    a -= 1
elif u == t:
    b -= 1
print(a,b)
import re
i = input()
print(re.sub('[abcdefghijklmnopqrstuvwyz]', 'x',i))
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    a=a-1
if s==t:
    b=b-1
print(a,b)
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 = input().split()
A,B = map(int,input().split())
U = input()
print((A-1,B) if S == U else print (A,B-1))
S, T = input().split()
A, B = map(int, input().split())
U = input()

print(A+B-1)
a=input()
S,T=a.split()[0],a.split()[1]
a=input()
A,B=int(a.split()[0]),int(a.split()[1])
U=input()

if(U=="red"):
  print(A-1," ",B)
else:
  print(A," ",B-1)
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

n = len(l())
s = ""
for i in range(n):
    s = s + "x"
print(s)
l=list(map(str,input().split(' ')))
r,b=map(int,input().split(' '))
find=input()

if find=="red":
    r-=1
else:
    b-=1
print(str(r)+" "+str(b))
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))
S,T = input().split()
A,B = map(int , input().split())
test_dict = {
    S:A,
    T:B
}
U = input()
test_dict[U] -= 1
print(list(test_dict.values())[0],list(test_dict.values())[1])
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if S==T:
  print(A-1,B)
else:
  print(A,B-1)
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))
a = dict(
  zip(
    list(input().split()),
    list(map(int, input().split()))
  )
)
U = input()
a[U] = a[U]-1

# アンパックする
print(*a.values())
S,T=map(str, input().split())
A,B=map(int, input().split())
U=str(input())
if 'r' in S:
    print(A-1,B)
elif 'b' in T:
      print(A,B-1)
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())

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

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

print(str(a) + " " + str(b))
s,t = list(input().split())
a,b = list(map(int, input().split()))

if input() == s:
  print(a-1)
else:
  print(b-1)
fs, bs = map(str,input().split())
ci, di = map(int,input().split())
es = str(input())

if es == fs:
  ca = ci - 1
  print(ca, di)
elif es == bs:
  da = di -1
  print(da, ci)
name_a,name_b=(x for x in input().split())
a_count,b_count=(int(x) for x in input().split())
fetch_color=input()
 
if fetch_color==name_a:
  a_coount = a_count-1
elif fetch_color==name_b:
  b_count = b_count-1
print(a_count,b_count)
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()
if choosen == n1:
    print(l1[1]-1, end=" ")
    print(l2[1])
if choosen == n2:
    print(l2[1]-1, end=" ")
    print(l1[1])
s,t=input().split()
a,b=map(int,input().split())
u=input()
if s==u:
    a-=1
else:
    b-=1
print(a+b)
S, T = input().split()
A, B = map(int, input().split())
U = input()

Balls = {}
Balls[S] = A
Balls[T] = B
Balls[U] -= 1

print(*Balls.values())
r,b = input().split()
num1,num2 = map(int,input().split())
u = input()
a = 0
b = 0
if u == r:
    a = num1-1
else: 
    a = num1
if u == b:
    b = num2-1
else: 
    b = num2
print(a,b)
map(int, input().split())
a, b = map(int, input().split())
u = input()
if u == 'red':
  print(a-1,b)
else:
  print(a,b-1)
s=input()
ans=str()
for i in range(len(s)):
    ans+="x"

print(ans)
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.rstrip())
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if s == u:
    a -= 1
elif s == t:
    b -= 1
print(str(a) + ' '+  str(b))
s, t = input().split()
num = list(map(int, input().split()))
u = input().split()

if u[0] == s:
  nums = num[0] -1
  numt = num[1]
else:
  nums = num[0] -1
  numt = num[1] -1

l = str(nums) + " " + str(numt)
print(l)
S,T = map(str, input().split())
A,B = map(int, input().split())
U = str(input())
if U == S:
    A-=1
else :
    B^=1
print('{} {}'.format(A,B))
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == "red" and t == "blue":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif s == "blue" and t == "red":
    if u == "red":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
else:
    print(int(a-1), int(b-1))
s, t = input().split()
a, b = map(int, input().split())
u = input()

if a == u:
    print(a-1, b)
else:
    print(a, b-1)
S = input()
w = ""
for i in range(len(S)):
    w += "x"
print(w)
S, T = input().split()
A, B = map(int, input().split())
U = input()

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

if s==u:
    print(a[1])
else:
    print(a[0])
d1 = input().split()
d = input().split()
d3 = input()
d2 = [int(x) for x in d]

if d1[0]==d3:
    d2[0]-=1
elif d1[1]==d3:
    d2[1]-=1

print("d2[0],d2[1]")
def main():
    S,T = input().split()
    A,B = map(int,input().split())
    U = input()
    dic = {S:A,T:B}
    dic[U] -= 1
    ans = list(dic.values())
    print(*ans,sep=" ")

if __name__ == '__main__':
    main()
a = [input().split() for i in range(3)]
b = list(map(int,  a[1]))
if a[0][0] ==a[2][0]:
    b[0] -=1
if a[0][1] ==a[2][0]:
    b[1]  -=1
b = list(map(str,  b))
' '.join(b)
a = dict(
  zip(
    list(input().split()),
    list(map(int, input().split()))
  )
)
U = input()
a[U] = a[U]-1

print(list(a.values()))
l=input().split() 
n = list(map(int, input().split()))
t=input()
if l[0]==t:
    n[0]=n[0]-1
    print(n)
elif l[1]==t:
    n[1]=n[1]-1
    print(n)
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(A-1, B if "S"=="U" else A, B-1)
N = input()
A = sorted(list(map(int,input().split())))
ans = "YES"
for i in range (1,len(A)):
    if A[i] == A[i-1]:
        ans = "NO"
print(ans)
#!/usr/bin/env python3
# https://atcoder.jp/contests/abc154/tasks/abc154_a

s, t = input().split()
a, b = [int(x) for x in input().split()]
u = input()
d = {}
d[s] = a
d[t] = b
d[u] -= 1
print(" ".join(list(map(str, list(d.values())))))
l = {}
s, t = map(str, input().split())
a, b = map(int, input().split())
l[s] = a
l[t] = b
u = input()
l[u] -= 1
print(' '.join(list(map(str, l.values()))))
_S, _T = input().split()
A, B = list(map(lambda x:int(x), input().split()))
U = input()


if U == A:
    is_type_A = True
else:
    is_type_A = False

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

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

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

d = {s: a, t: b}
d[u] = d[u] - 1
print(' '.join(map(str, d.values())))
S, T = input().split()
A, B = map(int, input().split())
U = input()

if S==U:
    print(A-1)
else:
    print(B-1)
import sys
[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))
sys.stdout.flush
word_list = [i for i in input().split()]
num_list = [int(num) for num in input().split()]
ext_word = input()

check_dict = dict(zip(word_list, num_list))

if ext_word in word_list:
    check_dict[ext_word] -= 1
else:
    pass

check_dict = [str(i) for i in check_dict.values()]
print(check_dict[0] + " " + check_dict[1])
s = input()
m = ""
for i in s:
    m = m + i.replace(i, 'x')
print(m)
#入力値を格納
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()

#個数を計算
if s == t:
    a = a - 1
else:
    b = b - 1

#結果を表示
print("{} {}".format(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)
ball = dict(zip(input().split(), map(int, input().split())))
u = input()

ball[u] -= 1
print(" ".join(map(str, ball.values())))
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)
S, a = input(), ""
for x in range(len(S)):
    a += "x"
print(a)
import sys


def resolve():
    input = sys.stdin.readline

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

    if S == U:
        A -= 1
        print(str(A) + ' ' + str(B))
        return
    B -= 1
    print(str(A) + ' ' + str(B))


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

if u.__eq__(s):
    print(a-1)
else:
    print(b-1)
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if S==U:
  print(A-1)
else:
  print(B-1)
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A+B)
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,B)
elif c == b:
    print(D,A)
b = input().split()
a = list(map(int, input().split()))
c = {b[i]: a[i] for i in range(len(b))}
d = input()
for i, j in c.items():
    print(j - 1 if i == d else j, end=" ")
S=input()
T=""
for i in range(len(S)):
  T+="x"
print(T)
S, T = input().split()
A,B = map(int,input().split())
U = input()
print(A,B)
if U == S:
  A -= 1
  print(A)
else:
  B -= 1
  print(B)
s,t=input().split()
a,b=map(int,input().split())
u=input().split()

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

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

print(str(a) + " " + str(b))
list=list(input())
for s in list:
    s='x'
print(''.join(list))
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 u == s:
    print(a-1)
else:
    print(b-1)
s, t = input().split()
a, b = map(int, input().split())
u = input()

if s == "red" and t == "blue":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif s == "blue" and t == "red":
    if u == "blue":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
else:
    print(int(a-1), int(b-1))
from sys import stdin

s = stdin.readline().rstrip()

r = ""
for i in range(len(s)):
    r += "x"

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

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

if s == u:
    a -= 1
elif s == t:
    b -= 1
print(a, b)
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)
else:
  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[0] , number[1])
a = input().split()
n = input().split()
c = input()
b = 0
d = 0
if c is a[0]:
    b =int(n[0])-1
else:
    d =int(n[1])-1
print(b,d)
from sys import stdin

S,T = stdin.readline().rstrip().split()
A,B = [int(x) for x in stdin.readline().rstrip().split()]
U = stdin.readline().rstrip().split()

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


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    d = collections.defaultdict(int)
    st = list(map(str, str(input().rstrip('\n')).split()))
    ab = list(map(str, str(input().rstrip('\n')).split()))
    for s, v in zip(st, ab):
        d[s] = int(v)
    d[str(input().rstrip('\n'))] -= 1
    print(" ".join(list(map(str, d.values()))))


if __name__ == '__main__':
    solve()
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input(str)
if S == U:
  print(A-1, end=" ")
  print(B)
else:
  print (A, end=" ")
  print(B-1)
S,T = input().split()
A,B = map(int,input().split())
d = {S:A,T:B}
U = input()
d[U] = d[U]-1
for i in d.values():
    print (i,end=" ")
l = {}
s, t = map(str, input().split())
a, b = map(int, input().split())
l[s] = a
l[t] = b
u = input()
l[u] -= 1
a = list(l.values())
print("{} {}".format(a[0], a[1]))
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if U == S:
    print(A - 1)
else:
    print(B - 1)
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

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

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


if U == 'red':
    print(max(A-1,0),B)
else:
    print(A,max(B-1,0))
S,T=input().split()
A,B=map(int,input().split())
U=S or T
if U==S:
  print(str(A-1))
else:
  print(str(B-1))
#入力
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())

#出力
if S == U:
    print( [A-1,B] )
else:
    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().split()
if s == u:
  a -= 1
else:
  b -= 1
print(a, b)
S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()
if U == S :
    ans = A - 1
else :
    ans = B - 1
print(ans)
a, b = map(str, input().split())
c, d = map(int, input().split())
e = map(str, input().split())
f = c - 1
g = d - 1
if a == e:
    print(c),
    print(g)
else:
    print(f),
    print(d)
d = {key:value for key, value in zip(input().split(), map(int, input().split()))}
d[input()] -= 1
print(' '.join(map(str, d.values())))
S = ['red', 'blue']
T = [3, 4]
U = 'red'

if U == 'red':
  print(T[0]-1, T[1])
elif U == 'blue':
  print(T[0], T[1]-1)
N=input()
A=input().split()
if(sorted(set(A), key=A.index)==A):
  print("YES")
else:
  print("NO")
import sys
input=sys.stdin.buffer.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
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 = list(map(int, input().split(' ')))
u = input()

m = {s: a, t: b}
print(m[u]-1)
from collections import defaultdict

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

d = defaultdict(int)

d[s] = a
d[t] = b
d[u] -=1

print(*d.values(), sep=" ")
S, T = input().split()
lis = list(input().split())
N1 = int(lis[0])
N2 = int(lis[1])
Z = input()
print(S,T,lis,Z,N1,N2)

if Z == S:
    print(N1-1,N2)
elif Z == T:
    print(N1,N2-1)
else:
    print(N1,N2)
S,T=input().split()
A,B=map(int,input().split())
U=input()
ST={S:A,T:B}
ST[U]-=1
print(*ST.values())
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))
from collections import defaultdict

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

d = defaultdict(int)

d[s] = a
d[t] = b
d[u] -= 1

print(*d.values())
from sys import stdin

s, t = stdin.readline().rstrip().split()
a, b = [int(x) for x in stdin.readline().rstrip().split()]
u = stdin.readline().rstrip().split()

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


print(str(a) + " " + str(b))
class atcoder:
    S=input()
    LEN=len(S)
    print(LEN*'x')
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('{} {}'.format(listBalls[0], listBalls[1]))
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U=="red":
    print(A-1,B)
else:
    print(A,B-1)
def main(s, t, a, b, u):
    if u == "red":
        print(a - 1, b)
    else:
        print(a, b - 1)


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

    main(s, t, a, b, u)
U = input('').split()
s = input('').split()
a = input('')
for i in range(0,len(U)):
    print(U[i])
for i in range(0,len(s)):
    s[i] = int(s[i])

for i in range(0,len(U)):
    if a == U[i]:
        s[i] += -1
        
print(s)
word = input()
list_ = ([i for i in word])
for i in range(len(list_)):
  list_[i] = 'x'
print(''.join(list_))
import sys
a,b=map(str, sys.stdin.readline().split())
c,d=map(int, sys.stdin.readline().split())
e=sys.stdin.readline()
if a==e:
  c-=1
else:
  d-=1
print(c,d)
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

    print(a, b)


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

if u==s:
  a -=1
else:
  b -=1
  
print(a,b)
S_T=input("S T:")
A_B=input("A B:")
U=input("U:")
list_S_T=[]
for i in range(len(S_T)):
    if S_T[i]==" ":
        S =S_T[0:i]
        T=S_T[i+1:len(S_T)]
for i in range(len(A_B)):
    if A_B[i]==" ":
        A = int(A_B[0:i])
        B = int(A_B[i+1:len(A_B)])
if S==U:
    A = A-1
elif T==U:
    B = B-1
print(A,B)
s,t = input().split()
a,b = input().split()
u = input()

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

if U == 'blue':
  B -=1
else:
  A -=1
  
print(A,B)
Ball = list(map(str, input().split()))
Num = list(map(int, input().split()))
OutputBall = input()
print((Num[0] - 1, Num[1]) if Ball[0] == OutputBall else (Num[0],
      Num[1] - 1))
# 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)
else:
    print(r,b-1)
S, T = input().split()
A, B = [int(n) for n in input().split()]
ans = {S:A, T:B}
U = input()
ans[U] -= 1
print([i for i in ans.values()])
s, t =  input().split()
a, b = map(int, input().split())
u = input()

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

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

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

m = {s: a, t: b}
print(m[u]-1)
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)
s,t = input().split()
a,b = input().split()
a = int(a)
b = int(b)
u = input()
  

print(s,t,a,b,u)

if u == s:
	a= a-1

elif u==t:
	b= b-1
  
print(a,b)
S,T=map(str,input().split())
A,B=map(int,input().split())
U=input()
if U=='red':
    print(A-1,'',B)
elif U=='blue':
    print(A,'',B-1)
#!/usr/bin/env python3

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

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

    print(A, B)


main()
A=input().split()
B=list(map(int,input().split()))
C=input()
if C=='red':
  B[0]=B[0]-1
else:
  B[1]=B[1]-1
print(B[0],B[1])
S,T = input().split()
A,B = map(int,input().split())
U = input()

S = A
T = B

if U == S:
	print(A - 1,B)
elif U == T:
	print(A,B - 1)
else:
	print(A,B)
name  = list(map(str, input().split()))
number=list(map(int, input().split()))
dash  =input()
print(dash)
if name[0] == dash:
   number[0]=number[0]-1
print(number)
import sys
read = sys.stdin.buffer.read #全てまとめて文字列として格納
readline = sys.stdin.buffer.readline # 一行読む
readlines = sys.stdin.buffer.readlines # 全行リストに格納

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

if u == s:
  a-=1
elif u == t:
  b-=1
print(a,b)
strings = input().split()
nums =  list(map(int, input().split(" ")))
delete = input()
for i in range(2):
    nums[i] = (nums[i] -1)  if strings[i] == delete else nums[i]
print(nums)
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)
import random
list1=[0,1,2,3,4,5,6,7,8,9]
list2=[0,1,2,3,4,5,6,7,8,9]
a = random.randint(0,9)
b = random.randint(0,9)
print(list1[a], list2[b])
S, T = input().split()
A, B = list(map(int,input().split()))
U = input()
 
if U == S:
  print(A-1)
else:
  print(B-1)
st = input().split()
kazu = list(map(int, input().split()))
u = input()
a = {st[0]: kazu[0], st[1]: kazu[1]}
a[u] -= 1
a = list(a.values())
print(a[0], a[1])