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 U==S:
  A=A-1
elif U==T:
  B=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(a,b)

Submission status: Accepted

Solution code:
s1 ,s2 = input().split()
n1,n2 = map(int,input().split())
st = input()

if st == s1:
    n1-=1
else:
    n2 -=1

print(n1,n2)

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:
c=input().split()
n=[int(i) for i in input().split()]
d=dict(zip(c,n))
d[input()]-=1
print(d[c[0]],d[c[1]])

Submission status: Accepted

Solution code:
str_list = input().split()
num_list =  [int(i) for i in input().split()]
del_boll = input()

boll_dic = {str_list[0]:num_list[0],str_list[1]:num_list[1]}
boll_dic[del_boll] -= 1

print(boll_dic[str_list[0]],boll_dic[str_list[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()
#print(s,t,a,b,u)

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

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)

Submission status: Accepted

Solution code:
S,T=[x for x in input().rstrip().split()]
A,B=[int(x) for x in input().rstrip().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 = input()

if U == S:
    A = A-1
elif U == T:
    B = 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] = d[u]-1
print(d[s], d[t])

Submission status: Accepted

Solution code:
s,t=map(str,input().split())
a,b=map(int,input().split())
u=str(input())
print((a-1),b) if u==s 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 = a-1
elif t==u:
    b = b-1
print(str(a)+ " " + str(b))

Submission status: Accepted

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

Submission status: Accepted

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

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

if U==S:
    d[S]-=1
else:
    d[T]-=1

print(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 s==u:
    a-=1
else:
    b-=1

print(a,b)

Submission status: Accepted

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

if st[0] == u:
    print(ab[0] - 1, ab[1])
else:
    print(ab[0], ab[1] - 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
if u == t:
    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 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)
elif u == t:
  print(a,b-1)
else:
  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(a,b)

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

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

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 = [i for i in input().split()]
A = [int(i) for i in input().split()]
U = input()

res = []
for i, j in zip(S,A):
    if i == U:
        j-= 1

    res.append(j)
print(*res)

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 main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()
    if S == U:
        print(A-1, B)
    else:
        print(A, B-1)
if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
s, t = map(str, sys.stdin.readline().split())
a, b = map(int, sys.stdin.readline().split())
u = sys.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=input().split()
a,b=map(int,input().split())
if input()==s:
    x=[a-1,b]
else:
    x=[a,b-1]
y = [str(n) for n in x]
print(' '.join(y))

Submission status: Accepted

Solution code:
s,t=[str(i) for i in input().split()]
a,b=[int(i) for i in 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 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:
	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:
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=a-1
else:
  b=b-1
print(a,b)

Submission status: Accepted

Solution code:
x = input().split()
y = input().split()
z = input().split()

a = int(y[0])
b = int(y[1])

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

Submission status: Accepted

Solution code:
former ,latter = map(str,input().split())
former_number  , latter_number = map(int,input().split())
check = input()
if check == former:
    print(former_number-1,latter_number) 
else:
    print(former_number,latter_number-1)

Submission status: Accepted

Solution code:
ST = input().split()
AB = [int(x) for x in input().split()]
U = input()

if U == ST[0]:
    AB[0] = AB[0]-1
else:
    AB[1] = AB[1]-1
print(AB[0], AB[1])

Submission status: Accepted

Solution code:
#copy

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

#文字列にmap()はいらない

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 u == s:

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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

def readInts():
  return list(map(int,input().split()))
def main():
    s,t = map(str,input().split())
    a,b = readInts()
    m = input()
    if m == s:
        print(a-1,b)
    else:
        print(a,b-1)
if __name__ == '__main__':
  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:
#!/usr/bin/env python3

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

if __name__ == "__main__":
    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 = 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=a-1
else:
    b=b-1
print(a,b)

Submission status: Accepted

Solution code:
red,blue=input().split()
red_num,blue_num=map(int,input().split())
throw=input()
if red==throw:
  red_num-=1
else:
  blue_num-=1
print(red_num,blue_num)

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 = list(input().split())
a,b = list(map(int, input().split()))

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

Submission status: Accepted

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

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

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 = 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 -= 1
    
if 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=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()

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc154/tasks/abc154_a

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:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict(list)
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s,t = input().split()
    a,b = readInts()
    u = input()
    if u == s:
        a -=1
    else:
        b -=1
    print(a,b)
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:
k = list(map(str, input().split()))
v = list(map(int, input().split()))
u = str(input())

if u == k[0]:
  print(v[0]-1, v[1])
else:
  print(v[0], v[1]-1)

Submission status: Accepted

Solution code:
S,T=map(lambda x: x, input().split())
A,B=map(int,input().split())
U=input()
L=[(S,A),(T,B)]
for l in L:
  x,y=l
  if x==U:
    print(y-1, end=" ")
  else:
    print(y, end=" ")

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 = input().split()
S = s[0]
T = s[1]

i = list(map(int, input().split()))
A = i[0]
B = i[1]

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

ans = {S:A, T:B}
ans[input()] -= 1

print(ans[S], ans[T])

Submission status: Accepted

Solution code:
n,k=map(str, input().split())
a,b=map(int, input().split())

u = input()

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S, T = S_MAP()
A, B = MAP()
U = input()

dic = defaultdict(int)
dic[S] = A
dic[T] = B
if dic[U] > 0:
    dic[U] -= 1
print(dic[S], dic[T])

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

Submission status: Accepted

Solution code:
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    L=list(map(str,input().split()))
    A,B=map(int,input().split())
    U=str(input())

    if U==L[0]:
        print(A-1,B)
    else:
        print(A,B-1)

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

if __name__ == "__main__":
  resolve()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s,t = input().split()
    a,b = LI()
    d = {}
    d[s] = a
    d[t] = b
    u = input()
    d[u] -= 1
    print(d[s],d[t])
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S, T = (i for i in input().split())
    A, B = (int(i) for i in input().split())
    U = input()
    if S == U:
        A -= 1
    else:
        B -= 1
    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input().split()
a = list(map(int, input().split()))
a[s.index(input())] -= 1
print(*a)

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=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:
    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:
    a -= 1

if t == u:
    b -= 1

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

Submission status: Accepted

Solution code:
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v, yes="Yes", no="No"):
    print([yes, no][not v])


def main():
    """エントリーポイント"""
    S, T, A, B, U = input(str, str, int, int, str)
    if (S == U):
        print(A - 1, B)
    else:
        print(A, B - 1)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from pprint import pprint
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

S, T = rs().split()
A, B = rl()
U = rs()

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

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:
import math

s1, s2 = input().split(" ")
a, b = map(int, input().split(" "))
c = input()

if s1 == c:
    a -= 1
if s2 == c:
    b -= 1

print(a, b)

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
    else:
        b -= 1

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


main()

Submission status: Accepted

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

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
S, T = input().split();
A = list(map(int, input().split()));
U = input();

if U == S:
  A[0] = A[0] - 1;
elif U == T:
  A[1] = A[1] - 1;

print(A[0], A[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 = 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:
import sys
input = sys.stdin.readline

S, T = input().split()
A, B = map(int, input().split())
if S == input().rstrip():
    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=input().split()
a,b=map(int,input().split())
u=input()
print('{} {}'.format(a-1,b) if u==s else '{} {}'.format(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 , sep=' ')
else:
    print(A, B-1, sep=' ')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N,K = map(str, input().split());r,b = map(int, input().split());p = input()
if p == N:
    r-=1
else:
    b-=1
print(r,b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = list(map(str,input().split()))
b = list(map(int,input().split()))
c = input()
if c == a[0]:
    print(b[0]-1,b[1])
else:print(b[0],b[1]-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 = 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().strip()
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 S == U:
    A -= 1
if T == U:
    B -= 1
print(A, B)

Submission status: Accepted

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

if (U==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 s == u:
  a -= 1
if t == u:
  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-=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()


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

Submission status: Accepted

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

Submission status: Accepted

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

d = {S: A, T: B}
d[U] -= 1

print(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(str(a-1) + " " + str(b))
elif u == t:
  print(str(a) + " " + str(b-1))

Submission status: Accepted

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

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:
  a -= 1
else:
  b -= 1
print(a,' ',b)

Submission status: Accepted

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

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