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

Submission status: Accepted

Solution code:
def main(s,t,a,b,u):
    if u == s:
        return "{0} {1}".format(a-1,b)
    else:
        return "{0} {1}".format(a,b-1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(str,input().split())
c,d = map(int,input().split())
e = input()
if e == a:
    c -=1
elif e == b:
    d -=1
print(c,d)

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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
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 functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

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


def main():
    ST = S_LIST()
    A, B = MAP()
    U = INPUT()

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

    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
strs = input().split()
nums = list(map(int, input().split()))
target = input()

if target == strs[0]:
    nums[0] -= 1
else:
    nums[1] -= 1

print(str(nums[0])+' '+str(nums[1]))

Submission status: Accepted

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

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

print(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 = ns().split()
a, b = na()
u = ns()
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)
elif T==U:
    print(A,B-1)

Submission status: Accepted

Solution code:
S, T = input().split()
A, B = [int(i) for i in 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()
m = {}
m[s] = a
m[t] = b

m[u] -= 1

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

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

Submission status: Accepted

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

if s == a:
  n = n - 1
if s == b:
  m = m - 1
  
print(n, m)

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()
ans=0
if u  in s:
  a-=1
if u in 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
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 U == S:
    A -= 1
elif U == T:
    B -= 1
print(str(A) + ' ' + str(B))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
s,t=input().split()
a,b=map(int,input().split())
u=input().strip()

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

Submission status: Accepted

Solution code:
S,T = input().split()
s,t = map(int,input().split())
U = input()

if U==S:
  s -= 1
else:
  t -= 1
  
print(s,t)

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
if u==t:
    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: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()))
N = input()

if S == N:
    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(a,b)

Submission status: Accepted

Solution code:
a,b = input().split()

x,y = map(int,input().split())

u = input()

if a == u:
    print(str(x-1) + " " + str(y))
else:
    print(str(x) + " " + str(y-1))

Submission status: Accepted

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

if __name__ == '__main__':
    run()

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

Submission status: Accepted

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


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

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

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

Submission status: Accepted

Solution code:
S,T = input().split()
s_num,t_num = map(int,input().split())
U = input()

if S==U:
    print(str(s_num-1)+" "+str(t_num))
else:
    print(str(s_num)+" "+str(t_num-1))

Submission status: Accepted

Solution code:
#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 = 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 = [i for i in input().split()]

sn, tn = [int(j) for j in input().split()]

u = input()

if (u == s):
    print(sn-1, tn)
else:
    print(sn, tn-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(a, end=' ')
print(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('{} {}'.format(A-1,B))
else:
    print('{} {}'.format(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:
T = input().split()
A = [int(a) for a in input().split()]
B = input()
if T[0] == B:
	print(A[0]-1,A[1])
else:
	print(A[0],A[1]-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(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:
import sys
sys.setrecursionlimit(100000)

def ii(): return int(input())
def iis(): return input().split()
def imi(): return map(int,iis())
def iil(): return list(imi())

s,t = input().split()
a,b = imi()
u = {s:a,t:b}
u[input()] -= 1
print(u[s], u[t])

Submission status: Accepted

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

print(A if U != S else A - 1, B if U != T else 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:
S,T=map(str,input().split())
s,t = map(int,input().split())
K=input()
if K == S:
  s-=1
else:
  t-=1
print(s,t)

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:
a = [s for s in input().split()]
N,Q = map(int, input().split())
t = input()

if t == a[0]:
    print(N-1, Q)
else:
    print(N, Q-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:
  a -= 1
else:
  b -= 1
print("{} {}".format(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:
        print(A-1, B)
    elif T == U:
        print(A, B-1)
    else:
        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=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 U==S:
  A=A-1
elif U==T:
  B = B-1

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

Submission status: Accepted

Solution code:
a = input().split()
b = [int(i) for i in input().split()]
c = input()

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

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':

    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:
s, t = input().split()
a, b = map(int,input().split())
x = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8
s, t = input().split()
a, b = map(int, input().split())
d = {s: a, t: b}
d[input()] -= 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 S == U:
    A -= 1
else:
    B -= 1

print(A, B)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
colors = list(map(str,input().split()))
count = list(map(int,input().split()))
A = input()
if colors[0] == A:
    print(count[0]-1,count[1])
else:
    print(count[0],count[1]-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 fractions import gcd
 
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()

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

Submission status: Accepted

Solution code:
x,y = map(str,input().split())
a,b = map(int,input().split())
c = input()
if c == x:
    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 = list(map(int,input().split()))
if input() == 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 = str(input())

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

nokori = {S:A, T:B}

nokori[U] -= 1

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

Submission status: Accepted

Solution code:
inputf = input

a,b = inputf().split(' ')
a_, b_ = inputf().split(' ')
a_ = int(a_)
b_ = int(b_)
c = inputf()

if c==a:
    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
else:
    B -= 1

print(A,B)

Submission status: Accepted

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

if U==S:
    A=A-1
if U==T:
    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:
    print(a-1)
    print(b)
else:
    print(a)
    print(b-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    S, T = [_ for _ in raw_input().split()]
    A, B = [int(_) for _ in raw_input().split()]
    U = raw_input()
    if U == S:
        print A - 1, B
    elif U == T:
        print A, B - 1

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a, b = input().split()

numa, numb = map(int,input().split())

pick = input()

if pick == a:
    print(str(numa - 1) + ' ' + str(numb))
else:
    print(str(numa) + ' ' + str(numb - 1))

Submission status: Accepted

Solution code:
import unittest


class TestA(unittest.TestCase):
    def test_1(self):
        # (actual_value, expected_value)
        self.assertEqual(True, False)


def solve():
    s, t, a, b, u = read()
    result = think(s, t, a, b, u)
    write(result)


def read():
    s, t = read_line().split(" ")
    a, b = read_int(2)
    u = read_line()
    return s, t, a, b, u


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(s, t, a, b, u):
    if s == u:
        return a - 1, b
    else:
        return a, b - 1


def write(result):
    print(result[0], result[1])


if __name__ == '__main__':
    # unittest.main()
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

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

Submission status: Accepted

Solution code:

import sys
import numpy as np
from collections import deque
from itertools import combinations
sys.setrecursionlimit(10**9)


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 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(str(a) + ' ' + str(b))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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:
    a-=1
else:
    b-=1
    
print('{} {}'.format(a,b))

Submission status: Accepted

Solution code:
s = input().split()
n = list(map(int, input().split()))
u = input()

if s[0] == u :
    n[0] -= 1
else :
    n[1] -= 1

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

Submission status: Accepted

Solution code:
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

s,t = input().split()
a,b = inm()
u = ins()
if u==s:
    print("{} {}".format(a-1,b))
else:
    print("{} {}".format(a,b-1))

Submission status: Accepted

Solution code:
def main():
    strings = input().split(" ")
    A, B = map(int, input().split(" "))
    U = input()
    if U == strings[0]:
        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 = A-1
else:
    B = B-1

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():
	S,T = map(str, sys.stdin.readline().split())
	A,B =MI()
	d = {S:A,T:B}
	U = IS()
	d[U]-=1
	print("{} {}".format(d[S], d[T]))

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

Submission status: Accepted

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

a, b = int(a), int(b)

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(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:
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()
    if U == S:
        A -= 1
    elif U == T:
        B -= 1
    else:
        pass

    print(A,B)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# A
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 = 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:
# ABC154 A
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
s,t=nm()
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:
import numpy as np

A, B = input().split()
x, y = map(int, input().split())
U = input()

if U == A:
	print(x-1, y)
else:
	print(x, y-1)

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


yn = 'YNeos'
ynflg = False
cnt = 0
ans = None

def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



# N = intinput()
# S = input()
# A, B, C, D, E, F = mulinputs()
# datas = list(mulinputs())
# datas = lineinputs(input)

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

Submission status: Accepted

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

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
    if u == t:
        b = 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())

dic = {S: A, T: B}
U = input()
dic[U] = dic[U]-1
print(dic[S], dic[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 S==U:
    print(A-1,end=' ')
    print(B)
else:
    print(A,end=' ')
    print(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 -= 1
if u == t:
    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 u==s:
        print(a-1,b)
    else:
        print(a,b-1)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

if u == s1:
    print(n1 - 1, n2)
else:
    print(n1, n2 - 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda x: [ni() for _ in range(x)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

s, t = nas()
a, b = na()
u = ns()

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