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):
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 998244353
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

s,t = LS()
a,b = LI()
u = S()

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

if U in ST[0]:
    print(A-1, B)
else:
    print(A, B-1)

Solution (Python):
S, T = input().split()
s, t = map(int, input().split())
U = input()
dic = {S:s, T:t}
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:
    a-=1
else:
    b-=1


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

Solution (Python):
a,b=input().split()
x,y=map(int,input().split())
c=input()
if a==c:
  x=x-1
else:
  y=y-1
print(x,y)

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())
print("{} {}".format(a - 1, b) if input() == s else "{} {}".format(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):

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


if __name__ == "__main__":
    main()

Solution (Python):
s,t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if u == s:
    print('{} {}'.format(a-1,b))
if u == t:
    print('{} {}'.format(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 = list(map(int, input().split()))
u = input()

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

Solution (Python):
st = list(map(str,input().split()))
ab = list(map(int,input().split()))
u = str(input())

ab[st.index(u)] -= 1

print(ab[0],ab[1])

Solution (Python):
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))

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, end=" ")
    print(B)
else:
    print(A, end=" ")
    print(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()
if U == S:
    A = A - 1
else:
    B = B - 1

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

Solution (Python):
s,a,u=open(0);i=u in s;print(int(a[:2])-1+i,int(a[2:])-i)

Solution (Python):
s,a,u=open(0);i=u in s;print(int(a[:2])-1+i,int(a[2:])-i)

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 = (int(x) for x in input().split())
u = input()

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

Solution (Python):
s,a,u=open(0)
i=s.find(u)<1
print(int(a[:2])-i,int(a[2:])-1+i)

Solution (Python):
color1 , color2 = input().split()
num1 , num2 = input().split()
int1 = int(num1)
int2 = int(num2)

dec = input()
if dec == color1:
  int1 -= 1
else:
  int2 -= 1

print("%d %d" %(int1,int2))

Solution (Python):
s, t = input().split()
a, b = [int(x) for x in 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()
ans = [int(i) for i in input().split()]
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[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 = 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 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:
    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=map(str,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):

import sys


def solve(S: str, T: str, A: int, B: int, U: str):
    if U == S:
        A-=1
    else:
        B-=1
    return A, B


def main():
    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)  
    s, t = solve(S, T, A, B, U)
    print(s, t)

if __name__ == '__main__':
    main()

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):
S,T = 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):
items=input().split()
nums=list(map(int, input().split()))
target=input()
if(target==items[0]):
    print(nums[0]-1,nums[1])
else:
    print(nums[0],nums[1]-1)

Solution (Python):
source = input().split()
number = input().split()
at = input()

if source[0] == at:
    number[0] = str(int(number[0]) - 1)
else:
    number[1] = str(int(number[1]) - 1)

print(number[0],number[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 = 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 -= 1
elif U==T:
    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 S == U:
    A = A - 1 
else:
    B = B - 1 

print(str(A) + " " + str(B))

Solution (Python):
import sys

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

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

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

Solution (Python):
S, T = map(str, 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,a,u=open(0);i=s.find(u)<1;print(int(a[:2])-i,int(a[2:])-1+i)

Solution (Python):
s = input().split()
i = list(map(int, input().split()))
r = input()

if r == s[0]:
  i[0] = i[0] -1
elif r == s[1]:
  i[1] = i[1] -1

print(i[0],i[1] )

Solution (Python):
a,b=input().split()
a_num,b_num=input().split()
c=input()
 
if c==a:
  a_num=int(a_num)-1
elif c==b:
  b_num=int(b_num)-1
print(a_num,b_num)

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,a,b,u=open(0).read().split();i=u==s;print(int(a)-i,int(b)-1+i)

Solution (Python):
s, t = 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):
from collections import OrderedDict
S, T = input().split()
A, B = [int(i) for i in input().split()]
U = input()
dic = OrderedDict(((S, A), (T, B)))
dic[U] -= 1
print(' '.join(map(str, dic.values())))

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

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

Solution (Python):
keys = input().split()
values = tuple(map(int, input().split()))

ball = dict(zip(keys, values))
u = input()

ball[u] -= 1
print(ball[keys[0]], ball[keys[1]])

Solution (Python):
S, T = map(str, 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()
A -= (S == U)
B -= (T == U)

print(A, B)

Solution (Python):
import sys


def resolve():
    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()

Solution (Python):
import sys
import math
import itertools
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):
import sys
import copy
input = sys.stdin.readline

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

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

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

if u==li[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:
    print(A - 1, B)
else:
    print(A, B - 1)

Solution (Python):
import sys

S, T = input().split()
A, B = [int(x) for x in input().split()]
U = input().strip()

if U == S:
    A -= 1
elif U == T:
    B -= 1
print(' '.join([str(x) for x in [A, B]]))

Solution (Python):
import sys

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

if U == S:
    A -= 1
elif U == T:
    B -= 1
print(' '.join([str(x) for x in [A, B]]))

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

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

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

print(A,B)

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

Solution (Python):
c = input().split()
c1,c2=c[0],c[1]
v=input().split()
v1,v2 = int(v[0]), int(v[1])
f = input()
if f==c1:
    v1-=1
else:
    v2-=1
print(str(v1) + ' ' + str(v2))

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()
if U == S:    A -= 1
else: B -= 1
print(A,B)

Solution (Python):






st = input().split()
st_list = []
st_list = [str(st) for st in st]


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


s = input()




if(str(s) == st_list[0]):
  a = a-1
elif(str(s) == st_list[1]):
  b = b-1


print(a,b)

Solution (Python):
input_data = [input() for i in range(3)]

ball_kinds = input_data[0].split(' ')
ball_counts = [int(i) for i in input_data[1].split(' ')]
target_ball = input_data[2]

for i in range(2):
    if ball_kinds[i] == target_ball:
        ball_counts[i] = ball_counts[i] - 1

print('{} {}'.format(ball_counts[0], ball_counts[1]))

Solution (Python):
colors = input().split()
nums= list(map(int, input().split(" ")))
flag = input()

for color, num in zip(colors, nums):
	if flag == color:
		print(num - 1, end = " ") 
	else:
		print(num , end = " ")

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

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("{} {}".format(A,B))

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):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	ST = input()
	ST = ST[:-1]
	STS = ST.split()
	A,B = inputMap()
	U = input()
	U = U[:-1]

	if U == STS[0]:
		A -= 1
	else:
		B -= 1

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

if __name__ == "__main__":
	main()

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

Solution (Python):
import sys

msg = sys.stdin.readlines()
lines = list()

for item in msg:
    if " " in item:
        s, t = item.split()
        lines.append(s)
        lines.append(t)
    else:
        item = item.replace('\n','')
        lines.append(item)

a = int(lines[2])
b = int(lines[3])

if lines[4] == lines[0]:
    a = a - 1
elif lines[4] == lines[1]:
    b = b - 1

print("{0} {1}".format(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):
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)

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 = input().split()
A, B = map(int, input().split())
U = input()

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

Solution (Python):
A=input().split()
B=list(map(int,input().split()))
C=input()
if C==A[0]:
  B[0]=B[0]-1
else:
  B[1]=B[1]-1
print(B[0], B[1])

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

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

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

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

print(A , " " , B)

Solution (Python):
X,Y = input().split()
A,B = map(int,input().split())
C = input()
if(X==C):
    print(A-1,B)
else:
    print(A,B-1)

Solution (Python):
[S, T] = input().split()
[A, B] = [int(x) for x in 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 T == U:
    print(A, B-1)
else:
    print(A-1, B)

Solution (Python):
a = [input() for i in range(3)]
x,y = map(str,a[0].split())
b,c = map(int,a[1].split())

if x == a[2]:
    b -= 1
    print(b,c)
else:
    c -= 1
    print(b,c)

Solution (Python):
import numpy as np
s,t=(x for x in input().split())
a,b=(int(x) for x in input().split())
u=input()

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

print(a,b,sep=" ")



"""
cd C:/Users/muto/Documents/AtCorder
python


入力
文字列
s=input()
整数
a=int(input())
区切り文字
b,c=(int(x) for x in input().split())

任意の文字数
a = int(input())
b=np.array(a)
b=(int(x) for x in input().split())
c=list(b)

2重ループを抜ける
flag=False
	else:
            flag=True
            break
    if flag:
        break

整数型int
小数型float

出力、区切り文字
print(str(a+b+c),s,sep=" ")
print('Odd')

if文
if a%2==1 and b%2==1:
else:

行列操作
b=np.array(a)
c[i]=int(c[i]/2)


import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd


def test():
    print('関数：testを呼び出しました')
 
if __name__ == '__main__':
 
    print('python-izm')
    test()


arr = np.asarray([1,2,3], dtype=np.int32)
np.float64
np.array(range(1, 10))


arr = np.asarray([[1,2,3], [4,5,6]])
np.zeros((2, 3))


np.random.rand(2, 3)
np.random.randint(0, 10, size=10)

np.zeros((2, 3))
np.random.shuffle(x)


a.dot(b)
np.dot(vecx, vecz)


np.multiply(x,y)


np.vstack((x, y))


np.mean(arr)
np.max(arr)
np.min(arr)
np.std(arr)
np.sum(arr)
np.sqrt

np.sum(arr, axis=0)

np.sum(arr, axis=1)


print(np.sort(x)[::-1])


x[0][1] = 100


arr.T


import tkinter
root = tkinter.Tk()


plt.plot([3,4,2,1])
plt.ylabel('some numbers')
plt.show()


plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()


x = np.arange(0., 5., 0.2)
plt.plot(x**3, 'b--')
plt.show()


plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
plt.show()


def f(t):
    return t
 
t = np.arange(0., 5., 0.2)
 
plt.plot(t, f(t), 'r--', t, g(t), 'bs', t, h(t), 'g^')
plt.show()


with open("Input.txt", 'r') as inputfile:
    lines = inputfile.readlines()
    x = []
    y = []
    for line in lines:
        value = line.replace('\n', '').split('\t')
        x.append(value[0])
        y.append(value[1]) 
    plt.plot(x, y)
    plt.show()


plt.savefig('hoge.png', dpi=300, orientation='portrait', transparent=False, pad_inches=0.0)


plt.savefig('test.pdf', orientation='portrait', transparent=False, bbox_inches=None, frameon=None)




"""

Solution (Python):
a = input().split()
b = list(map(int,input().split()))
u = input()
for i,j in enumerate(a):
	if j == u:
		b[i] -= 1
print(*b)

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

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 s == u:
    a -= 1
elif t == u:
    b -= 1
print(a, b)

Solution (Python):



s = [input() for i in range(3)]
ST = list(s[0].split())
S = str(ST[0])
T = str(ST[1])

AB = list(s[1].split())
A = int(AB[0])
B = int(AB[1])

U = str(s[2])



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


print(str(A)+" "+str(B))

Solution (Python):
sName, tName = map(str, input().split())
sNum, tNum = map(int, input().split())
uName = input()

if uName == sName:
    sNum = sNum - 1
elif uName == tName:
    tNum = tNum - 1

print("{} {}".format(sNum, tNum))

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

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 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(A-1,B)
else:
    print(A,B-1)

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

Solution (Python):
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)
a_ans = 0
b_ans = 0
if len(list_target) == len(list_target_a):
    for i in range(len(list_target_a)):
        if list_target[i] == list_target_a[i]:
            a_ans += 1

if a_ans == len(list_target_a):
    a -= 1

if len(list_target) == len(list_target_b):
    for i in range(len(list_target_b)):
        if list_target[i] == list_target_b[i]:
            b_ans += 1

if b_ans == len(list_target_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
if t == u:
    b -= 1

print(a,b)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

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)


    return 

if __name__ == '__main__':
    main()

Solution (Python):
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()

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

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

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

s = A
t = B

if U == S:
  s -= 1
else:
  t -= 1

print(s, t)

Solution (Python):
color = input().split()
 
num = input().split()

stock = {}
stock[color[0]] = num[0]
stock[color[1]] = num[1]
 
u = input().split()
 
stock[u[0]] = int(stock[u[0]]) - 1
 
print('{col1} {col2}'.format(col1=stock[color[0]],col2=stock[color[1]]))

Solution (Python):
inputlist=input().split()
s=inputlist[0]
t=inputlist[1]

aaa=input()
b=aaa.split(sep=" ")
c=list(map(int, b))

new_dict={}
new_dict[s]=c[0]
new_dict[t]=c[1]

inputfruit  =   input()
if inputfruit==s:
    ans = new_dict[s]-1
    new_dict[s] = ans
else:
    ans = new_dict[t]-1
    new_dict[t]=ans

sonoichi =new_dict[s]
sononi  =   new_dict[t]
print(sonoichi, sononi)

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

Solution (Python):
from sys import stdin
S, T = map(str, stdin.readline().rstrip().split())
A, B = map(int, stdin.readline().rstrip().split())
U = str(stdin.readline().rstrip())
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)

Solution (Python):
S,T = input().split(" ")
A,B = input().split(" ")
U = input()
a = int(A)
b = int(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()
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):
a,b=input().split()
c,d=map(int,input().split())
e=input()
 
if a==e:
	c = c - 1
else:
	d = d - 1
 
print(c,d)

Solution (Python):
a,b = map(str,input().split())
c,d = map(int,input().split())
n = input()
if n == a:
    print(str(c-1)+" "+str(d))
else:
    print(str(c) + " " + str(d-1))

Solution (Python):
c = input().split()
n = input().split()
u = input()
if c[0] == u:
	n[0] = str(int(n[0])-1)
else:
  	n[1] = str(int(n[1])-1)
print(' '.join(n))

Solution (Python):
a,b = map(str,input().split())
c,d = map(int,input().split())
n = input()
if n == a:
    print(str(c-1)+" "+str(d))
else:
    print(str(c) + " " + str(d-1))

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

dic = {}
dic[S] = A
dic[T] = B
U = input()
dic[U] -= 1

print(str(dic[S]) + " " + str(dic[T]))

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

Solution (Python):
s, t = map(str, 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()


aCount, bCount = input().split()
aNumber = int(aCount)
bNumber = int(bCount)

ball = []
ball.append(aNumber)
ball.append(bNumber)


selectBall = input()

if selectBall == a:
    aNumber = aNumber-1
    ball[0] = aNumber
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bNumber = bNumber-1
    ball[1] = bNumber
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

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 S == U:
    A = A-1
    
if T == U:
    B = B-1
    
print(A, B)

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

if u == s:
    print(int(a) - 1, '' + b)
else:
    print(a + '', int(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('{} {}'.format(A, B))

Solution (Python):
a = list(input().split())
b = list(map(int, input().split()))
e = a
f = b
c = input()
d = {key: val for key, val in zip(e, f)}
d[c] -= 1
print(d[a[0]], d[a[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)
else:
    print(a,b-1)

Solution (Python):
import sys

S, T = input().split(" ")
A, B = input().split(" ")

A = int(A)
B = int(B)

U = input()

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

print(A, B)

Solution (Python):
l = [input().split() for i in range(3)]
STl = l[0]
ABl = l[1]
Ul = l[2]
U = Ul[0]

ABl[STl.index(U)] = str(int(ABl[STl.index(U)]) - 1)
print(' '.join(ABl))

Solution (Python):
n,m = input().split()
r,b = map(int,input().split())
t = input()
if n == t:
  print(str(r-1) + ' ' + str(b))
else:
  print(str(r) + ' ' + str(b-1))

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

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

Solution (Python):
s, t = map(str, input().lower().split())
a, b = map(int, input().lower().split())
u = input()
dicts = {}
dicts.update([(s,a),(t,b)])
dicts[u] = dicts[u] - 1
print("%d %d" %(dicts[s], dicts[t]))

Solution (Python):
S, T = input().split()
A, B = list(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:
    a -=1
elif u == t:
    b -=1
print(str(a)+" "+str(b))

Solution (Python):
input_list = input().split()
input_list2 = list(map(int, input().split()))
delete_ball = input()
for ind, n in enumerate(input_list):
  if n == delete_ball:
    input_list2[ind] -= 1
ans = ""
for m in input_list2:
  ans += str(m) + " "
print(ans.rstrip())

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

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:
    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()

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

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

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

if s == u:
  a -=1
elif 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 u == s:
    print(a-1, b)
elif u == t:
    print(a, b-1)

Solution (Python):
ss = input()
ll = ss.split()
s = ll[0]
t = ll[1]
aa = input()
lll = aa.split()
a = int(lll[0])
b = int(lll[1])
uu = input()
if uu == s:
    a = a-1
else:
    b = b-1
print(a,end = " ")
print(b)

Solution (Python):
s, t = map(str, 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):
def main():
    S,T = input().split()
    A,B = map(int,input().split())
    U = input()
    dic = {S:A,T:B}
    dic[U] -= 1
    print(dic[S],dic[T])

if __name__ == '__main__':
    main()

Solution (Python):
a = input().split()
b = list(map(int,input().split()))
c = input()
x=int(a.index(c))
y=int(b[x])
del b[x]
u=y-1
b.insert(x,u)
print(*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):
a,b=input().split()
A,B=map(int,input().split())
c=input()
if a==c:
  A=A-1
else:
  B=B-1
print(A,B)

Solution (Python):
s, t = input().split()
a, b = input().split(" ")
u = input()
a = int(a)
b = int(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()

if U == S:
    print('{} {}'.format(A-1,B))
if U== T:
    print('{} {}'.format(A, B-1))

Solution (Python):
S, T = input().split()
A, B = list(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 = 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
else:
	b-=1
print(a,b)

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

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

print(A,B)