Problem:


Score : 100 points

Problem Statement

We have A balls with the string S written on each of them and B balls with the string T written on each of them.

From these balls, Takahashi chooses one with the string U written on it and throws it away.

Find the number of balls with the string S and balls with the string T that we have now.

Constraints

S, T, and U are strings consisting of lowercase English letters.

The lengths of S and T are each between 1 and 10 (inclusive).

S \not= T

S=U or T=U.

1 \leq A,B \leq 10

A and B are integers.

Input

Input is given from Standard Input in the following format:

S T
A B
U

Output

Print the answer, with space in between.

Sample Input 1

red blue
3 4
red

Sample Output 1

2 4

Takahashi chose a ball with red written on it and threw it away.
Now we have two balls with the string S and four balls with the string T.

Sample Input 2

red blue
5 5
blue

Sample Output 2

5 4

Takahashi chose a ball with blue written on it and threw it away.
Now we have five balls with the string S and four balls with the string T.



Sample input:
red blue
3 4
red


Sample output:
2 4

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s,t= 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:
def main():
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

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

if S == U:
    print(A-1, B, sep=' ')
elif T == U:
    print(A, B-1, sep=' ')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = readline().decode('utf-8').split()
a, b = map(int, readline().split())
u = read().decode('utf-8').rstrip()

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

print(a, b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def solve():
    S, T = input().split()
    A, B = map(int, input().split())
    if input()==S:
        return '{} {}'.format(A-1, B)
    else:
        return '{} {}'.format(A, B-1)

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S, T = [x for x in input().split()]
    A, B = [int(x) for x in input().split()]
    U = input().strip()

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

    






if __name__ == '__main__':
    main()

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 = map(str, input().strip().split())
a, b = map(int, input().strip().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 -= 1
    else:
        b -= 1    
    print(a,b)
    return

if __name__=="__main__":
    main()

Submission status: Accepted

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

if u == a:
    print(s-1,t)
else:
    print(s,t-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:
import sys
input = sys.stdin.readline

s, t = input().strip().split()
a, b = [int(i) for i in input().split()]
u = input().strip()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a, b = input().split()
n, m = map(int, input().split())
s = input()
if s == a:
	print('{} {}'.format(n-1, m))
else:
    print('{} {}'.format(n, m-1))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
li= list(input().split())
num= list(map(int, input().split()))
u=input()
if li[0]==u:
    print(num[0]-1,num[1])
else:
    print(num[0],num[1]-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 = 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 U==S:
  a=a-1
else:
  b=b-1
print(a,b)

Submission status: Accepted

Solution code:
# abc 154
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

S, T = list(map(str, readline().split()))
A, B = list(map(int, readline().split()))
U = str(readline().strip())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s1, s2 = map(str, input().split())
a, b = map(int, input().split())
s3 = input()

if(s1==s3):print(a-1, b)
else:print(a, b-1)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
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:
MOD = 1000000007
INF = float("inf")

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 = str(input())

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

Submission status: Accepted

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

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

s = 0
t = 0

if S == U:
    s = 1
elif T == U:
    t = 1
    
print(A-s,B-t)

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, U = map(str, input().split())
s, u = map(int, input().split())
n = input()

if n == S:
    s -= 1
else:
    u -= 1

print(s, u)

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

Submission status: Accepted

Solution code:
s1,s2 = input().split()
n1,n2 = map(int,input().split())
s = input()
if s == s1:
    print(n1-1,n2)
if s == s2:
    print(n1,n2-1)

Submission status: Accepted

Solution code:
s, t = input().split()
a,b = map(int, input().split())
u = input()
d = dict()
d[s] = a
d[t] = b
d[u] -= 1
print('{} {}'.format(d[s],d[t]))

Submission status: Accepted

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

S, T = readline().strip().split()

A, B = map(int, readline().split())

U = readline().strip()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ans = [a, b]
print(*ans)

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
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    vn = vk = vn_k = 1
    for i in range(1, n+1):
        vn = vn * i % modp
        if i == k:
            vk = vn
        if i == n-k:
            vn_k = vn
    return vn * get_inv(vk, modp) * get_inv(vn_k, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

def main():
    S, T = input().split()
    A, B = mis()
    U = input()
    if U==S:
        print(A-1,B)
    else:
        print(A,B-1)



main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(A,B)

Submission status: Accepted

Solution code:
import numpy as np

if __name__ == "__main__":
  _s, _t  = input().split()
  _a, _b = map(int, input().split())
  _u = input()

  if _s == _u:
    _a -= 1
  else:
    assert _t == _u
    _b -= 1
  print(_a, _b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
st = input().split(" ")
ab = input().split(" ")
ab[0] = int(ab[0])
ab[1] = int(ab[1])
u = input()

if st[0] == u:
    ab[0] -= 1
else:
    ab[1] -= 1

print(str(ab[0]) + " " + str(ab[1]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#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:
w= input().split()
wm, wn = map(int, input().split())
wi = input()

if wi == w[0]:
    wm -= 1
else:
    wn -= 1

print(wm, wn)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:



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




if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

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

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

print(A, B)

Submission status: Accepted

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

d = {s: a, t: b}
d[u] -= 1
print(str(d[s]) + ' ' + str(d[t]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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(str(a)+" "+str(b))

Submission status: Accepted

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

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




if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S, T = list(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:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

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

D = {}
D[S] = A
D[T] = B
D[U] -= 1
print(D[S], D[T])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    s, t = input().split()
    A = list(map(int, input().split()))
    tmp = input()
    if tmp == s:
        A[0] -= 1
    elif tmp == t:
        A[1] -= 1
    print('%d %d' % (A[0], A[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:
    print(a-1, b)
else:
    print(a, b-1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

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

if u == s:
    n -= 1
else:
    m -= 1

print(n, m)

Submission status: Accepted

Solution code:
# coding: utf-8
# = int(input())
# = 
s,t = [x for x in input().split()]
a,b = [int(x) for x in input().split()]
u = input()
if s == u:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces
gi = lambda : list(map(int,input().split()))
s, t = input().split()
a, b = gi()
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:
    print(A-1,B)
else:
    print(A,B-1)

Submission status: Accepted

Solution code:
S, T = (st for st in input().split())
A, B = (int(ab) for ab in 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:
  A-=1
else:
  B-=1

print(A,B)

Submission status: Accepted

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s1, s2 = input().split()
s1s, s2s = map(int, input().split())
a = input()

if a == s1:
  s1s -= 1
else:
  s2s -= 1
  
print("{} {}".format(s1s, s2s))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

S,T = input().split()

A,B=input_int()

U=one_str()

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

Submission status: Accepted

Solution code:
import bisect
import numpy as np
import math
import itertools
def main():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    if S == U:
        A -= 1
    elif T == U:
        B -= 1
    print(A, B)
    return 0


    return 0
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:
        A -= 1
    else:
        B -= 1

    print(A, B)


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


print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s,t = SL()
ss,tt = IL()
n = S()

if s == n:
  ss -= 1
if t == n:
  tt -= 1
print(ss,tt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
x, y = input().split()
ans = list(map(int,input().split()))

s = input()

if s == x:
    ans[0] -= 1
else:
    ans[1] -= 1

print(" ".join(map(str, ans)))

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

Submission status: Accepted

Solution code:
s = input()
t = s.split()
a, b = [int(x) for x in input().split()]
u = input()
if u==t[0]:
    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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
import pprint
sys.setrecursionlimit(10 ** 9)


INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


s, t = LS()
a, b = LI()
x = S()
if s == x:
    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:
def main():
    str_list = list(input().split(' '))
    a, b = map(int, input().split(' '))
    if str_list.index(input()):
        b -= 1
    else:
        a -= 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:
       print(a-1,b)
else:
       print(a,b-1)

Submission status: Accepted

Solution code:
import sys

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

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

if __name__ == '__main__':
    ans = main()
    print(*ans, sep=' ')

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

if u == t:
  b = b-1

print(a, b)

Submission status: Accepted

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

if 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:
    ans = [a-1, b]
else:
    ans =[a ,b-1]
print(*ans)