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.



Sample input:
red blue
3 4
red


Sample output:
2 4

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import fractions
def main():
  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)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
inp=input()
arr1=inp.split(" ")
arr2=list(map(int,input().strip().split()))[:2]
inp1=input()
if(inp1==arr1[0]):
    arr2[0]-=1
elif(inp1==arr1[1]):
    arr2[1]-=1
print(arr2[0],arr2[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S,T=input().split()
a,b=[int(s) for s in input().split()]
U=input()
if S==U:
  a-=1
else:
  b-=1
print(*[a,b])

Submission status: Accepted

Solution code:
S, T = list(map(str, input().split()))
NS, NT = list(map(int, input().split()))
a = str(input())
if a==S:
    NS-=1
else:
    NT-=1
print(NS, NT)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strbase = input().split()
base = input().split()
u = input()
a = int(base[0])
b = int(base[1])
if u == strbase[0]:
    a = a-1
if u == strbase[1]:
    b = b-1
print(a,b)

Submission status: Accepted

Solution code:
a, b = input().split()
c, d = map(int, input().split())
e = input()
if e == a:
    print('{} {}'.format(c-1, d))
else:
    print('{} {}'.format(c, d-1))

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    solve(S, T, A, B, U)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s,t = input().split()
num_s,num_t =map(int,input().split())
u = input()
if u == s:
    num_s -= 1
else:
    num_t -= 1
print('{0} {1}'.format(num_s , num_t))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

if __name__ ==  '__main__':
    main(a, b)

Submission status: Accepted

Solution code:
# coding: utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

if a==e:
  print(c-1,end=" ")
  print(d)
if b==e:
  print(c,end=" ")
  print(d-1)

Submission status: Accepted

Solution code:
i=0
a=0
b=0
c=input()
while i<len(c):
	if c[i]==' ':
		break
	i+=1
s=c[0:i]
s=s.strip()
t=c[i+1:]
t=t.strip()
c=input()
i=0
while i<len(c):
	if c[i]==' ':
		break
	i+=1
aa=c[0:i]
a=int(aa.strip())
bb=c[i+1:]
b=int(bb.strip())
u=input()
if u==s:
	print(a-1,b)
else:
	print(a,b-1)

Submission status: Accepted

Solution code:
S, T = input().split()
A, B = map(int, input().split())
U = input()
pool1 = [S for i in range(A)]
pool2 = [T for i in range(B)]

pool = pool1 + pool2

pool.remove(U)

print(pool.count(S),pool.count(T))

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = input().split()
li2 = list(map(int,input().split()))
c = input()
d = {li[0]:li2[0], li[1]:li2[1]}
d[c] -= 1
print(d[li[0]], d[li[1]])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def ism():return map(str,input().split())
def iil():return list(map(int,input().split()))
s,t=ism()
a,b=iim()
u=input()

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

Submission status: Accepted

Solution code:
def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S, T = list(input().split())
A, B = list(map(int, input().split()))
U = input()
dict = {}
dict[S] = A
dict[T] = B
dict[U] -= 1
print(dict[S], dict[T])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s, t = input().split()
a, b = map(int, input().split())
u = input()
if s == u:
    a -= 1
else:
    b -= 1
print(a, b)

Submission status: Accepted

Solution code:
ST = list(map(str, input().split()))
num = list(map(int, input().split()))
U = str(input())

if U == ST[0]:
  num[0] -= 1
else:
  num[1] -= 1

num = [str(i) for i in num]
num = ' '.join(num)
print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

U=input()

if S==U:
    A[0]-=1
else:
    A[1]-=1

print(*A)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S, T = map(str,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))

Submission status: Accepted

Solution code:
s, t = input().split()
a, b = map(int, input().split())
u = input()
x = {s:a, t:b}
x[u] -= 1
print('{} {}'.format(x[s], x[t]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
array = [input() for i in range(3)]
dic_data = {}
color = array[0].split(" ")
total = array[1].split(" ")
sub   = array[2]

dic_data[color[0]] = int(total[0])
dic_data[color[1]] = int(total[1])

if sub == color[0]:
    dic_data[color[0]] = dic_data[color[0]] - 1
elif sub == color[1]:
    dic_data[color[1]] = dic_data[color[1]] - 1

print(dic_data[color[0]], dic_data[color[1]])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
# 初期入力
S_str,T_str = (x for x in input().split(" "))
A_S_num,B_T_num = list(map(int, input().split()))
U_S_or_T = input()

#
if U_S_or_T ==S_str:
    A_S_num -= 1
elif U_S_or_T == T_str:
    B_T_num -= 1
print(A_S_num,B_T_num)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = {}

d[s] = a
d[t] = b

d[u] -= 1

print("{} {}".format(d[s], d[t]))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(str(A) + ' ' + str(B))

Submission status: Accepted

Solution code:
x , y = map(str,input().split(" "))
a , b = map(int,input().split(" "))
z = input()

if x == z:
    print(str(a-1) + " " + str(b))
elif y == z:
    print(str(a) + " " + str(b-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()
    if U == S:
        print(str(A - 1) + " " + str(B))
    elif U == T:
        print(str(A) + " " + str(B - 1))

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
(s,t),(a,b),u=input().split(),map(int,input().split()),input();print(a-(s==u),b-(t==u))

Submission status: Accepted

Solution code:
s, t = map(str, input().split())
n,m = map(int, input().split())
u = input()

if u == s:
    n -= 1
elif u == t:
    m -= 1
    
print(n, m)

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


def main():
    s= list(input().split())
    a = list(map(int, input().split()))
    z = input()
    i = s.index(z)
    a[i] -= 1
    print(a[0])
    print(a[1])
    


main()

Submission status: Accepted

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

Submission status: Accepted

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

if a == e:
    print(c-1, d)

if b == e:
    print(c, d-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S, T = input().split()
A, B = (int(x) for x in input().split())
print('%d %d' %(A-1, B) if input() == S else '%d %d' %(A, B-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S,T = map(str,input().split())

A,B = map(int,input().split())

U = input()

#print(S,T,U)

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

Submission status: Accepted

Solution code:
C1,C2= map(str,input().split())
CN1,CN2= map(int,input().split())
ColorTaken = str(input())
if ColorTaken == C1 :
    print ( CN1 - 1 , CN2 )
else :
    print ( CN1 , CN2 - 1  )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i, j = input().split()
a, b = map(int, input().split())
k = input()
if k == i:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

d[u] -= 1

print('{} {}'.format(d[s], d[t]))

Submission status: Accepted

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

balls = {s : a, t: b}

u = input()

balls[u] -= 1

print("{} {}".format(balls[s], balls[t]))

Submission status: Accepted

Solution code:
# coding: utf-8
s,t = input().split()
a,b = map(int, input().split())
u = input()

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

Submission status: Accepted

Solution code:
S,T = input().split()
C = list(map(int,input().split()))
U = input()
if S == U:
  C[0] -= 1
else:
  C[1] -= 1
print("{} {}".format(C[0],C[1]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().split()
A = list(map(int,input().split()))
U = input()
a = S.index(U)
A[a] -= 1
print(A[0],A[1])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    solve(S, T, A, B, U)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_S, _T = input().split()
A, B = list(map(lambda x:int(x), input().split()))
U = input()


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

if is_type_A:
    print(A - 1, B)
else:
    print(A, B-1)

Submission status: Accepted

Solution code:
str_a,str_b = input().split()
num_a,num_b = map(int, input().split())
kye_str = input()
if str_a == kye_str:
  num_a = num_a - 1
else:
  num_b = num_b - 1
print(str(num_a) + " " +str(num_b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S, T = [str(_) for _ in input().split()]
A, B = [int(_) for _ in input().split()]
U = str(input())
if U == S:
    A = A - 1
else:
    B = B - 1
print(A,B)

Submission status: Accepted

Solution code:
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][1])

U = str(M[2])


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

print(str(a) + ' ' + str(b))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

Solution code:
stra, strb = [str(_) for _ in input().split()]
n1  , n2   = [int(_) for _ in input().split()]
strDel     = str(input())
if stra == strDel:
    print(n1-1, n2)
elif strb == strDel:
    print(n1, n2-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
col1,col2=map(str,input().split())
no1,no2=map(int,input().split())
check=str(input())
if check==col1:
  print(no1-1,no2)
else:
  print(no1,no2-1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s,t = list(input().split())
a,b = list(map(int,input().split()))
u = input()

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

Submission status: Accepted

Solution code:
# A - Remaining Balls

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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
    print(*[A - 1, B])
else:
    print(*[A, B - 1])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
s, t = input().split()
a, b = map(int, input().split())
u = input()
balls = {s: a, t: b}
if u in balls.keys():
  balls[u] -= 1
print('{} {}'.format(balls[s], balls[t]))

Submission status: Accepted

Solution code:
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,d-1))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(*solve(S, T, A, B, U))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputST = input()
STlist = inputST.split(" ")
s = STlist[0]
t = STlist[1]

inputAB = input()
ABlist = inputAB.split(" ")
a = int(ABlist[0])
b = int(ABlist[1])

u = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def get_ints():
    return map(int, input().split())

s, t = input().split()
a, b = get_ints()
u = input()
if u == s:
    print(str(a - 1) + ' ' + str(b))
else:
    print(str(a) + ' ' + str(b - 1))

Submission status: Accepted

Solution code:
def main():

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

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

    u = str(input())

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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