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 = 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:
s=list(input().split())
a,b=map(int,input().split())
print(a,b-1) if s.index(input())==1 else print(a-1,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()
st = {}
st[s] = a
st[t] = b
st[u] -= 1
print('{} {}'.format(st[s], st[t]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(str,input().split())
X,Y=map(int,input().split())
C=input()

if A==C:
    print(X-1,Y)
else:
    print(X,Y-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(A,B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s, t = input().split()
    a, b = 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 =  input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  A -= 1
else:
  B -= 1
print(A, B, sep=' ')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if s == u:
    print(a-1)
    print(b)
else:
    print(a)
    print(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
elif t==u:
  b=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 = str(input())
    if s == u:
        print(a-1, b)
    else:
        print(a, b-1)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 文字列だからmapはいらない
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()

# sがa個 tがb個 あって、uを1個捨てる
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=input().split()
a,b=map(int,input().split())
n=input()
if S==n:
  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:
        A = A - 1
    else:
        B = B - 1

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if U == S:
  N = N - 1

if U == T:
  M = M - 1

print(N, M)

Submission status: Accepted

Solution code:
S,T = input().split()
N,M = list(map(int, input().split()))
s = input()
if s == S:
  print(N-1, M)
else:
  print(N, M-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 U == S:
    A = A - 1
else:
    B = 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()
d = {}
d[s] = a
d[t] = b
d[u] -= 1
print(d[s], d[t])

Submission status: Accepted

Solution code:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

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

    
main()

Submission status: Accepted

Solution code:
s, t = input().split()
s_num , t_num = map(int, input().split())
u = input()

if u == s:
    print(s_num-1, t_num)
else:
    print(s_num, t_num -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())
d={s:a,t:b}
u=input()
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 = list(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=input()
# print(a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  name = list(map(str,input().split()))
  num = list(map(int,input().split()))
  n = input()
  if n==name[0]:
    print(num[0]-1,num[1])
  else:
    print(num[0],num[1]-1)

main()

Submission status: Accepted

Solution code:
s,t = input().split()
snum, tnum = map(int,input().split())
selection = input()

if (selection == s):
    print(snum-1,tnum)
else:
    print(snum,tnum-1)

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

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()
ST={S:A,T:B}
ST[U]-=1
print(ST[S],ST[T])

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=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:
first = input().split(" ")
second = input().split(" ")
third = input()

if third == first[0]:
    print(int(second[0])-1, second[1])
else:
    print(second[0], int(second[1])-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 = 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:
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 = input().split()
a,b = map(int,input().split())
u = input()
if u==s[0]:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

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

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

    print(a, b)
resolve()

Submission status: Accepted

Solution code:
s, t = input().split()
a, b = [int(x) for x in input().split()]
u = input()
print(a - (u == s), b - (u == t))

Submission status: Accepted

Solution code:
s,t = [x for x in input().split()]
a,b = [int(x) for x in input().split()]
ss = input()

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

Submission status: Accepted

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

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(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 = 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
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)
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:
#!/usr/bin/env python3
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    S, T = (s.decode() for s in readline().rstrip().split())
    A, B = map(int, readline().split())
    U = readline().rstrip().decode()
    if S == U:
        A -= 1
    else:
        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 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 = 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 = 'red' , 'blue'
#a , b = 3,4
#u = 'red'

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

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(str(A) + ' ' + str(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)
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()
num1,num2=map(int,input().split())
throw=input()

if throw==S:
    num1-=1
else:
    num2-=1
    
print(num1,num2)

Submission status: Accepted

Solution code:
import numpy

S, T = map(str, input().split())
AB = list(map(int, input().split()))
U = input()

if U == S:
    tmp = numpy.array([1,0])
else:
    tmp = numpy.array([0,1])
print(numpy.array(AB-tmp)[0], numpy.array(AB-tmp)[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)


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

a = A - 1
b = B - 1

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

Submission status: Accepted

Solution code:
x = input().split()
y = input().split()
z = input()
if x[0] == z:
  y[0] = int(y[0]) - 1
elif x[1] == z:
  y[1] = int(y[1]) - 1
print(str(y[0])+' '+str(y[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('{} {}'.format(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=list(map(int,input().split()))
U=input()

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

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

Submission status: Accepted

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

# print((a-1,b) if (s[0]==u) else a,b-1)
if s[0]==u:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

Solution code:
x = list(input().split())
y = list(map(int, input().split()))
z = input()
y[x.index(z)] -= 1
print("{0} {1}".format(y[0], y[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()
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 (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:
    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 = 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 = 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 u == s:
    print(a - 1, b)
elif u == t:
    print(a, b - 1)
else:
    print(a, b)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
# https://atcoder.jp/contests/abc154/tasks/abc154_a

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

print(A - (S == U), B - (T == U))

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

print(a, b)

Submission status: Accepted

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

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, sep =" ")

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

if __name__ == "__main__":
  resolve()

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:
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:
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

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

Submission status: Accepted

Solution code:
#! env/bin/local python3

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

balls = {
    s: a,
    t: b
}

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

print(a, b)

Submission status: Accepted

Solution code:
def main():
    s, t = input().split()
    a, b = list(map(int, input().split()))
    u = input()
    
    if s == u:
        a -= 1
    if 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( 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 = str(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-=1
else:
    B-=1
print(A,B)

Submission status: Accepted

Solution code:
s,t=input().split()
S,T=map(int,input().split())
dis=input()
if s==dis:
    print(S-1,T)
else:
    print(S,T-1)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()[:-1]
    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:
  print(a-1,b)
else:
  print(a,b-1)

Submission status: Accepted

Solution code:
def resolve():
    s,t=input().split()
    a,b=map(int,input().split())
    u=input()
    if s==u:
        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()
if U == S:
  print(A-1, B)
if 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:
  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 S == U:
  A = A - 1
elif T == U:
  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 = input()
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 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(a-1,b)
elif t==u:
  print(a,b-1)

Submission status: Accepted

Solution code:
import sys
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def ISS(): return sys.stdin.readline().rstrip().split()

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

Submission status: Accepted

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

f = str(input())

if f == m:
  a = a -1
else:
  b = 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()
print(a-1 if s==u else a,b if s==u else 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 = 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 = map(str,input().split())
A,B = map(int,input().split())
U = str(input())

if U == S:
    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 s == u:
    a -= 1
elif t == u:
    b -= 1

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

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

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

print(a)
print(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 = 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:
import sys
import math
from collections import deque
from collections import defaultdict

def main():
    s, t = input().split()
    a, b = list(map(int,sys.stdin.readline().split()))
    u = input()
    if u == s:
        a -= 1
    else: b -= 1
    print(a,b)
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

w1, w2 = input().split()
a,b = map(int,input().split())
c = input()
l = [[w1,a],[w2,b]]
ans = ""
for i in range(2):
    x,y = l[i][0],l[i][1]
    if x==c:
        ans += str(y-1)
    else:
        ans += str(y)
    if i==0:
        ans += ' '

print(ans)

Submission status: Accepted

Solution code:
import collections
s,t = raw_input().split(' ')

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

Submission status: Accepted

Solution code:
n=2
s=[""]*n
a=[0]*n
s[:]=input().split()
a[:]=map(int,input().split())
u=input()
for ii in range(n):
  if s[ii]==u:
    a[ii]-=1
    break
print(" ".join([str(ii) for ii in a]))

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

print(a, b)

Submission status: Accepted

Solution code:
# ABC154A

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

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

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

Submission status: Accepted

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

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

print(A, B)