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: Wrong Answer

Solution code:
import sys


def resolve():
    input = sys.stdin.readline

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

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


resolve()

Submission status: Wrong Answer

Solution code:
print(input())

Submission status: Wrong Answer

Solution code:
import sys
[N, T] = list(map(str, input().split()))
[A, B] = list(map(int, input().split()))
U = input()
print(N, T, A, B, U)
if (N == U):
    A -= 1
else:
    B -= 1
print("{} {}".format(A, B))
sys.stdout.flush

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S, T = input().split()
A, B = [int(n) for n in input().split()]
ans = {S:A, T:B}
U = input()
ans[U] -= 1
print([i for i in ans.values()])

Submission status: Wrong Answer

Solution code:
balls_color = input().split()
balls_count = map(int, input().split())

balls = dict(zip(balls_color, balls_count))
trash = input()

balls[trash] -= 1

print(*balls.values())

Submission status: Wrong Answer

Solution code:
[N, T] = list(map(str, input().split()))
[A, B] = list(map(int, input().split()))
U = input()
print(N, T, A, B, U)
if (N == U):
    A -= 1
else:
    B -= 1
print("{} {}".format(A, B))

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline
    
    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__":
    resolve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S,T=map(list,input().split())
A,B=map(int,input().split())
U=(input())
if A >0 and U=="red":
  print(A-1,B)
elif B>0 and U=="blue":
  print(A,B-1)
elif A==0 and U=="red":
  print(0,B)
elif B==0 and U=="blue":
  print(A,0)

Submission status: Wrong Answer

Solution code:
from sys import stdin
lines = stdin.readlines()
 
S, T = map(str, lines[0].split())
A, B = map(int, lines[1].split())
U = lines[2]

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

print(a, b)

Submission status: Wrong Answer

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

#入力
S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())

#処理
if S == U:
    print(B)
else:
    print(A)

Submission status: Wrong Answer

Solution code:
s = input().split()
num = [int(i) for i in input().split()]
u = input()
num1 = num[0]
num2 = num[1]

if s[0] == u:
    nums = num1 - 1
    print("{} {}".format(nums, num1))
elif s[1] == u:
    nums = num2 - 1
    print("{} {}".format(num1, nums))

Submission status: Wrong Answer

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

A, B = [int(i) for i in input().split()]

U = input().split()

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

Submission status: Wrong Answer

Solution code:
a=input()
import re
result=re.sub(r'[a-z]', "x", a)
print(result)

Submission status: Wrong Answer

Solution code:
s = list(input().split())
a = list(map(int, input().split()))
a[s.index(input())] -= 1
for i in a:
  print(i, end = '')

Submission status: Wrong Answer

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

c = {s:a, t:b}
c[u] -= 1

for i in c.values(): print(i,end=" ")
print()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def main():
    StringS,StringT = input().split();
    StringA,StringB = input().split();
    StringU = input();

    wkA=int(StringA);
    wkB=int(StringB);
    if StringU == StringS :
        wkA = wkA - 1;
        print(wkA);
    else:
        wkB = wkB - 1;
        print(wkB);

main()

Submission status: Wrong Answer

Solution code:
a = list(map(str, input().split()))
b = list(map(int, input().split()))
c = list(map(str, input().split()))
if a[0] == c:
	b[0] = b[0] - 1
else: b[1] = b[1] -1
print(b[0],b[1])

Submission status: Wrong Answer

Solution code:
L = input().split()
S = L[0]
T = L[0]
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: Wrong Answer

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

if U == "red":
    A -= 1
else:
    B -= 1

print(A, B)

Submission status: Wrong Answer

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass

n = len(l())
s = ""
for i in range(n):
    s = s + "x"
print(s)

Submission status: Wrong Answer

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc154/abc154_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S,T = i2s().split()
    A,B = i2nn()
    U = i2s()
    d = {S:A, T:B}
    d[U] -= 1
    print(*d.values())
    return

main()

Submission status: Wrong Answer

Solution code:
target_a, target_b = list(map(str, input().split()))
a, b = map(int, input().split())
target = input('')
list_target_a = list(target_a)
list_target_b = list(target_b)
list_target = list(target)

if len(list_target) == len(list_target_a):
    a -= 1
elif len(list_target) == len(list_target_b):
    b -= 1

print(a, b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read #全てまとめて文字列として格納
readline = sys.stdin.buffer.readline # 一行読む
readlines = sys.stdin.buffer.readlines # 全行リストに格納

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

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

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

if u=="blue":
    print(str(a)+" "+str(b-1))
elif u=="red":
    print(str(a-1)+" "+str(b))

Submission status: Wrong Answer

Solution code:
N,M = map(str,input().split())
NN,MM = map(int,input().split())
ress = input()
if(ress == N):
  NN = NN-1
elif(ress == M):
  MM == MM-1
print(NN,MM)

Submission status: Wrong Answer

Solution code:
args = input().split()
S = args[0]
T = args[1]

args2 = input().split()
a = int(args2[0])
b = int(args2[1])

U = input()

if U == S:
	print(str(a-1))
	
else:
	print(str(b-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s,t=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: Wrong Answer

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

if u[0] == s:
  nums = num[0] -1
  numt = num[1]
else:
  nums = num[0] -1
  numt = num[1] -1

l = str(nums) + " " + str(numt)
print(l)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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


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

Submission status: Wrong Answer

Solution code:
def main(s, t, a, b, u):
    if u == "red":
        print(a - 1, b)
    else:
        print(a, b - 1)


if __name__ == "__main__":
    s, t = input().split()
    a, b = map(int, input().split())
    u = input()

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

Submission status: Wrong Answer

Solution code:
[S, T] = [x for x in 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: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
s,t=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: Wrong Answer

Solution code:
s=input()
print('x'*len(s))

Submission status: Wrong Answer

Solution code:
S = input()
l = len(S)
print('x'*l)

Submission status: Wrong Answer

Solution code:
w = input().split()
print(w)
l = [int(i) for i in input().split()]
l[w.index(input())] -= 1
print(*l)

Submission status: Wrong Answer

Solution code:
import sys

def main():
    k = input().replace('\n','').split()
    a = input().replace('\n','').split()
    u = input().replace('\n','')
    a[k.index(u)]=int(a[k.index(u)]) - 1
    print(a[0],a[1])
if __name__ == '__main__':
    input = sys.stdin.readline
    main()

Submission status: Wrong Answer

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


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


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#a_L = list(map(int,input().split()))

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

Submission status: Wrong Answer

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: Wrong Answer

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

if u == "red":
	a -= 1
else:
	b -= 1

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

Submission status: Wrong Answer

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

d={S:A,T:B}

d[U]-=1

for i in list(d.values()):
    print(i, end=" ")

Submission status: Wrong Answer

Solution code:
import sys
from pprint import pprint

def solve(s, t, a, b, u):
    if u == "red":
        a -= 1
    if u == "blue":
        b -= 1
    print(a, b)

if __name__ == '__main__':
    s, t = sys.stdin.readline().strip().split(" ")
    a, b = map(int, sys.stdin.readline().strip().split(" "))
    u = sys.stdin.readline().strip()
    solve(s, t, a, b, u)

Submission status: Wrong Answer

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


if U == 'red':
    print(max(A-1,0),B)
else:
    print(A,max(B-1,0))

Submission status: Wrong Answer

Solution code:
N,M = map(str,input().split())
NN,MM = map(int,input().split())
ress = input()
if(ress == N):
  NN = NN-1
elif(ress == M):
  MM == MM-1
print(MM,NN)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

set = {s:a, t:b}
if u == s: set[s] -= 1
else: set[t] -= 1

for i in set.values(): print(i,end=" ")
print()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S,T=input().split()
A,B=map(int,input().split())
U=input()
dic={S:A,T:B}
dic[U]-=1
for v in dic.values():
    print(v,end=' ')

Submission status: Wrong Answer

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

    if ss == s:
        print(str(a-1) + ' ' + str(b))
        return
    else:
        print(str(a) + ' ' + str(b))
if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read #全てまとめて文字列として格納
readline = sys.stdin.buffer.readline # 一行読む
readlines = sys.stdin.buffer.readlines # 全行リストに格納

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

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

Submission status: Wrong Answer

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

if s == t:
  a -= 1
else:
  b -= 1
print(str(a) + " " + str(b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc154/abc154_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S,T = i2s().split(' ')
    A,B = i2nn()
    U = i2s()
    d = {S:A, T:B}
    d[U] -= 1
    print(*d.values())
    return

main()

Submission status: Wrong Answer

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(A,B)

Submission status: Wrong Answer

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

if U == "red":
    A -= 1
else:
    B -= 1

print(A, B)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S, T = input().split()
A, B = MAP()
U = input()
print(S, T)
if U == S:
	print(A - 1, B)
if U == T:
	print(A, B - 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

if u == 'red':
    a -= 1
else:
    b -= 1

print(a, b)

Submission status: Wrong Answer

Solution code:
# a = list(map(int, input().split()))
# N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
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,copy
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 LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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


if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

if U == "red":
    print(A-1, B)

else:
    print(A, B-1)

Submission status: Wrong Answer

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

if s==u:
    print(a[1])
else:
    print(a[0])

Submission status: Wrong Answer

Solution code:
def main():
    S,T = input().split()
    a,b = map(int,input().split())
    u = input()
    print(a-1,b if S == u else a,b-1)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w1, w2 = input().split()
a, b = [int(i) for i in input().split()]
d = {w1: a, w2: b}

d[input()] -= 1

print(*d.values())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if u == "red":
  a-=1
else:
  b-=1
  
print(str(a) + " " + str(b))

Submission status: Wrong Answer

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

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

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

Submission status: Accepted

Solution code:
#154-A
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()
print(a if u == t else a-1, end = " ")
print(b-1 if u == t else 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:
from operator import xor
from functools import reduce


def resolve():
    s, t = input().split()
    a, b = map(int, input().split())
    d = {s: a, t: b}
    u = input()
    d[u] -= 1
    print(d[s], d[t])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 = 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()
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 -= 1
else:
	b -= 1

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

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

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(A,B)

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
def main():
    X = LS()
    S_ = X[0]
    T = X[1]
    A, B = MI()
    U = S()
    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()
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())
if s==input():
    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)