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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print("%d %d"%(A,B))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    A=[0]*3
    B=[0]*3
    for i in range(3):
        if i==1:
            A[i],B[i] = map(int,input().split())
        elif i==0:
            A[i],B[i] = input().split()
        else:
            A[i]=input()
    
    if A[2]==A[0]:
        A[1]-=1
    else:
        B[1]-=1
    print(A[1],B[1])

    
main()

Submission status: Accepted

Solution code:
s1,s2=input().split()
count1,count2=map(int,input().split())
s3=input()

if s1==s3:
    count1-=1
if s2==s3:
    count2-=1
print(count1,count2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S,T = input().split(' ')
A,B = list(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 = input().split()
a = list(map(int,input().split()))
u = input()

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

print(a[0],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:
S, T = map(str ,input().split(' '))
A, B = map(int ,input().split(' '))
U = input()

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

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:
# -*- coding: utf-8 -*-
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 U == S:
    print(A - 1, B)
else:
    print(A, B - 1)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
words = input().split(" ")
numbers_input = input().split(" ")
numbers = []
for i in numbers_input:
  numbers.append(int(i))
u = input()
for i, word in enumerate(words):
  if word == u:
    numbers[i] -= 1

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

Submission status: Accepted

Solution code:
def main():
  A, B = map(str, input().split())
  a, b = map(int, input().split())
  T = str(input())

  if(A == T):
    a -= 1
  else:
    b -= 1
  print(a, b) 
if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

ST = read_str()
S, T = list(ST.split())
AB = read_int()
A, B = AB
U = read_str()

def solve():
    ans = 0
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)
    return A, B

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
    *a,=map(int,open(0))
def S_():
    return input()
def IS():
    return input().split()
def LS():
    return [i for i in input().split()]
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def NI(n):
    return [int(input()) for i in range(n)]
def NI_(n):
    return [int(input())-1 for i in range(n)]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def LtoS(ls):
    return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']

mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()
 
def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a
 
show_flg=False
show_flg=True
 
ans=0

s,t=input().split()
n,m=LI()
u=input()
if s==u:
    n-=1
else:
    m-=1

print(n,m)

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:
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=map(str,input().split())
A,B=map(int,input().split())
N=str(input())
ans=A
ans2=B
if N==S:
    ans=A-1
if N==T:
    ans2=B-1
print(ans,ans2)

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

S = inputs[0]
T = inputs[1]

A = nums[0]
B = nums[1]
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 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))
else:
    print(str(A) + " " + str(B-1))

Submission status: Accepted

Solution code:
balls = input().split(" ")
nums = input().split(" ")
nums = [int(i) for i in nums]
u = input()

nums[balls.index(u)] -= 1

print("{} {}".format(nums[0], nums[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()

dic = {}
dic[s] = a
dic[t] = b

dic[u] = dic[u] - 1

print(str(dic[s]) + " " + str(dic[t]))

Submission status: Accepted

Solution code:
import sys
from pprint import pprint

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

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

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

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

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if S == U:
    Snew = A-1
    Tnew = B
else:
    Snew = A
    Tnew = B-1
    
Snew = str(Snew) 
Tnew = str(Tnew)
Ans =Snew+" "+Tnew

print(Ans)

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

f = sys.stdin
S, T = f.readline()[:-1].split(' ')
A, B = map(int, f.readline().split(' '))
U = f.readline()[:-1]

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

Submission status: Accepted

Solution code:
#At coder 2020/2/9 A

# スペース区切りの数の入力
S, T = input().split()
A, B = map(int,input().split())
U=input()

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

print(A,B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s, t = input().split()
num_a, num_b = input().split()
rm = input()
if rm==s:
    num_a = int(num_a) - 1
else:
    num_b = int(num_b) -1

print('{0} {1}'.format(num_a, num_b))

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

ans = [A,B]
print(*ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_s =[input() for i in range(3)]
color_1, color_2 = list(input_s[0].split())
a, b = list(map(int,input_s[1].split()))
color = input_s[2]
if  color == color_1:
    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:
    a -= 1
elif u == t:
    b -= 1

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

Submission status: Accepted

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

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

print(A,B)

Submission status: Accepted

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

d = {S: A, T: B}
d[U] -= 1
print('{} {}'.format(d[S], d[T]))

Submission status: Accepted

Solution code:
ball_color = list(map(str, input().split()))
ball_num = list(map(int, input().split()))
trash_color = input()

if (trash_color == ball_color[0]):
    ball_num[0]=ball_num[0]-1
elif (trash_color == ball_color[1]):
    ball_num[1]=ball_num[1]-1

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

Submission status: Accepted

Solution code:
a, b = map(str, input().split())
num_a, num_b = map(int, input().split())
c = str(input())

if c==a:
  print(num_a-1, num_b)
else:
  print(num_a, num_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 = input().split()
A, B = input().split()
A = int(A)
B = int(B)
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):
    A -= 1
else:
    B -= 1

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

Submission status: Accepted

Solution code:
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


def fetch_ints_inputs(times):
    return [fetch_int_input() for _ in range(times)]


a, b = fetch_one_line().split(" ")
a_n, b_n = [int(i) for i in fetch_one_line().split(" ")]
remove_str = fetch_one_line()

if a == remove_str:
    a_n -= 1

else:
    b_n -= 1

print(a_n, b_n)

Submission status: Accepted

Solution code:
a,b = input().split()
c,d = map(int,input().split())
e = input()
dic = {a:c, b:d}

dic[e]+=-1

print(dic[a],dic[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()
i,j=map(int,input().split())
u=input()

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc154/tasks/abc154_a
# -*- coding: utf-8 -*-
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 = list(input().split())
a, b = list(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:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


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


def LF(): return list(map(float, input().split()))


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(str, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    S, T= LS()
    A,B= LI()
    U= input().rstrip()



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


    
    return

# B


def B():
    N,K,M = LI()
    A = LI()
    ans=M*N- sum(A)
    if ans>K:
        print(-1)
    elif ans<0:
        print(0)
    else:
        print(ans)


    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def C():
    N, M = LI()
    P=[]
    S=[]
    count=set([])
    ans=[0]*1000000
    realans=0
    for i in range(M):

        p,s=input().split()
        p=int(p)
        if s=='AC':
            realans+=ans[p]
            count.add(p)
            ans[p]=0
        if s=='WA' and p not in count:
            
            ans[p]+=1
  


    
    print(len(count),realans)
    

        


        

# D


def D():

    H, W= LI()
    S=[]
    d=0
    for i in range(H):
        tmp=input().rstrip()
        c=0
        for j in tmp:
            if '.'==j:
                S.append(d*100+c)
            c+=1
        d+=1
    print(S)



    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    A()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
arr = input().split(" ")
num = list(map(lambda x: int(x), input().split(" ")))
lost = input()

if arr[0] == lost:
    num[0] = num[0] - 1
elif arr[1] == lost:
    num[1] = num[1] - 1
print(str(num[0]) + " " + str(num[1]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def I(): return int(input())
def MI(): return map(int, input().split())
def LMI(): return list(map(int, input().split()))


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

Submission status: Accepted

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

if s == u:
    a -= 1
else:
    b -= 1
print(' '.join(map(str, [a, b])))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
slist = raw_input().split()
nlist = map(int, raw_input().split())

sel = raw_input()

if sel == slist[0]:
    print nlist[0]-1, nlist[1]
else:
    print nlist[0], nlist[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(a-1,b)
elif t == u :
    print(a,b-1)

Submission status: Accepted

Solution code:
st = input().split()

ab = list(map(int, input().split()))

u=input()

if st[0]==u:
    print(ab[0]-1,end="")
    print(" ",end="")
    print(ab[1])
elif st[1]==u:
    print(ab[0],end="")
    print(" ",end="")
    print(ab[1]-1)

Submission status: Accepted

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

if S == U:
  out_1 = A - 1
  if out_1 < 0: out1 = 0
  out_2 = B
  print(out_1, out_2)

if T == U:
  out_1 = A
  out_2 = B -1
  if out_2 < 0: out_2 = 0
  print(out_1, out_2)

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:
c1, c2 = input().split()
n = input().split()
n1 = int(n[0])
n2 = int(n[1])
u = input()
if(u == c1):
  print(str(n1 - 1) + " " + str(n2))
else:
  print(str(n1) + " " + str(n2 - 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:
if __name__ == "__main__":
    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 = map(str, input().split())

s_num, t_num = map(int, input().split())

u = str(input())

input_dict = {s:s_num, t:t_num}

input_dict[u] -= 1

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
str1, str2 = input().split()
str1_count, str2_count = map(int, input().split())
str3 = input()

if(str3 == str1):
    str1_count -= 1
else:
    str2_count -= 1
    
print(str1_count, str2_count)

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

color_1, color_2 = input().split()

co1_n, co2_n = map(int, input().split())

del_col = input()

if del_col == color_1:
    co1_n -= 1
if del_col == color_2:
    co2_n -= 1
    
print(str(co1_n), str(co2_n))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s, t = input().split()
n_s, n_t = map(int, input().split())
if input() == s:
    n_s -= 1
else:
    n_t -= 1

print(n_s, n_t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
sList = list(input().split())
nList = list(map(int,input().split()))

s = input()

if s == sList[0]:
  nList[0] -= 1
else:
  nList[1] -= 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ST = input().split()
num = list(map(int, input().split()))
U = input()

if (U == ST[0]):
    num[0] -= 1
else:
    num[1] -= 1

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

Submission status: Accepted

Solution code:
color=[i for i in input().split()]
num=[int(i) for i in input().split()]
rem=input()

if rem==color[0]:
    num[0]-=1
    print(str(num[0])+" "+str(num[1]))
    
else :
    num[1]-=1
    print(str(num[0])+" "+str(num[1]))
    
print()

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 S==U:
    A-=1
else:
    B-=1
    

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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