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

print(x, y)

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

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

Submission status: Accepted

Solution code:
keys = list(map(str, input().split()))
values = list(map(int, input().split()))
rm_str = input()

dicts = {key: value for key, value in zip(keys, values)}
dicts[rm_str] = dicts[rm_str] - 1

print(' '.join([str(n) for n in list(dicts.values())]))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s,t = input().split()
a,b = [int(x) for x in 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 = map(str, input().split())
A, B = map(int, input().split())
U = input()

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

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

Submission status: Accepted

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

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

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

ab = input().split()
A = int(ab[0])
B = int(ab[1])
U = input()

new_a = A - 1 if S == U else A
new_b = B-1 if T == U else B

print("{} {}".format(new_a, new_b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ri = lambda S: [int(v) for v in S.split()]
def rii(): return ri(input())

S, T = input().split()
A, B = rii()
U = input()
D = {S:A, T:B}
D[U] -= 1

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

Solution code:
S,T = 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:
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
  A=A-1
elif U==T:
  B=B-1
print("{} {}".format(A,B))

Submission status: Accepted

Solution code:

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

print(A, B)

Submission status: Accepted

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

print(A, B)

Submission status: Accepted

Solution code:
s,t = input().split()
a,b = 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 = input().split()
a = list(map(int, input().split()))
pos = s.index(input())
a[pos] -= 1
print(*a)

Submission status: Accepted

Solution code:
S, T = [s for s in input().split(' ')]
A, B = [int(s) for s in input().split(' ')]
U = input()
d = {S:A,T:B}

d[U] = d[U] - 1
print('%d %d' % (d[S], d[T]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s, t = [i for i in input().split()]
a, b = [int(i) for i in input().split()]
u = input()
if u == s:
	a -= 1
else:
	b -= 1
print("%d %d" % (a, b))

Submission status: Accepted

Solution code:
import os, sys, re, math

(S, T) = [n for n in input().split()]
(A, B) = [int(n) for n in input().split()]
U = input()

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

print('%s %s' % (A, B))

Submission status: Accepted

Solution code:
keys = input().split(' ')
vals = list(map(int, input().split(' ')))
hoge = input()
print(vals[0]-(keys[0]==hoge), vals[1]-(keys[1]==hoge))

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

Submission status: Accepted

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

Submission status: Accepted

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

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

Submission status: Accepted

Solution code:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()
if 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:
# coding: utf-8
# Your code here!
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(int(a-1),int(b))
else:
    print(int(a),int(b-1))

Submission status: Accepted

Solution code:
s,r=input().split()
x,y=map(int,input().split())
t=input()
if(t==s):
    x=x-1
if(t==r):
    y-=1
print(x,y)

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

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = 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:
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:
a,b=input().split()
ST={}
ST[a], ST[b] = map(int, input().split())
ST[input()]-=1

for k,v in ST.items():
  print(v,end=' ')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
n = list(map(int, input().split()))
U = input()
n[s.index(U)] -= 1
print(n[0], n[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:
    A-=1
else:
    B-=1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
red, blue= input().split()
r, b = [int (x) for x in input().split()]
s = input()
if s == red:
    r = r - 1
else:
    b = b - 1
print(r, end=" ")
print(b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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 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:
S, T = input().rstrip().split()
A, B = [int(v) for v in input().rstrip().split()]
U =  input().rstrip()
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):
    print(A-1,B)
elif (U == T):
    print(A,B-1)

Submission status: Accepted

Solution code:
list1=input().split()
S=list1[0]
T=list1[1]
A,B=map(int,input().split())
U=input()
if U==S:
  a=A-1
  print(f"{a} {B}")
if U==T:
  b=B-1
  print(f"{A} {b}")

Submission status: Accepted

Solution code:
S,T = input().split() #文字列のの複数一行入力
A,B = map(int,input().split()) #数値の複数一行入力(形は覚える)
U = input() #文字列の入力

if U == S: #もしUとSが同じだった場合

    print(A-1,B) #(問題文より、)Aから1引いてAとBを出力

else: #そうでなかった場合(UとTが同じだった場合)

    print(A,B-1) #Bから1引いてAとBを出力

'''例
入力
S = red , T = blue
A = 3 , B = 4
U = red

UはSと同じだから,Sに対応するAから1引いてA(2)とB(4)を出力する

出力
2 4
'''

Submission status: Accepted

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

Submission status: Accepted

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

ind = S.index(U)

A[ind] -= 1

print(" ".join(list(map(str, A))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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


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


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

u=input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s, t = 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 = list(map(int, input().split()))
U = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N_dict  = {i:0 for i in list(map(str,input().split()))}
N_List = list(map(int,input().split()))
ct = 0
for i in N_dict.keys():
    N_dict[i] = N_List[ct]
    ct += 1

N_dict[str(input())] -= 1
print(" ".join(list(map(str,N_dict.values()))))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

s, t = map(str, input().split())
a, b = inm()
u = ins()
if u == s:
    print(a-1, b)
else:
    print(a, b-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(str(a)+' '+str(b-1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
words = list(map(str,input().split()))
score = list(map(int,input().split()))
word = input()
if word == words[0]:
    print(score[0]-1,score[1])
else:
    print(score[0],score[1]-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin 

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
S, T = next(sys.stdin).strip().split()
A, B = map(int, next(sys.stdin).split())
U = next(sys.stdin).strip()

if U == S:
  A -= 1
elif U == T:
  B -= 1
else:
  raise ValueError

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

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

print(f'{A} {B}')

Submission status: Accepted

Solution code:
# Remaining Balls
colors  = list(input().split())
numbers = list(map(int, input().split()))
u = input()
numbers[colors.index(u)] -= 1
print(' '.join([str(e) for e in numbers]))

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

print(a, b)

Submission status: Accepted

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

if '__main__' == __name__:
    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("{} {}".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 = 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=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 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 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:
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(str(A - 1) + ' ' + str(B))
elif T == U :
  print(str(A) + ' ' + str(B - 1))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
S, T = input().split()
A, B = map(int, input().split())
if S == input():
    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:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}"


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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