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:
(n, k), *D,  = [s.split() for s in open(0)]

d = dict()
d[n] = int(D[0][0])
d[k] =  int(D[0][1])
d[D[1][0]] -= 1

print(d[n], d[k])

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

def resolve():
    a,b = list(map(str,input().split()))
    c,d = list(map(int,input().split()))
    e=input()

    if a==e:
        c-=1

    if b==e:
        d-=1 

    print(str(c)+" "+str(d))

    return

resolve()

Submission status: Accepted

Solution code:

s,t = map(str, input().split())
u,v = map(int, input().split())

cc = input()

if cc == s:
    u -=1
else:
    v -=1

print(str(u)+" "+str(v))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

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

Submission status: Accepted

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

arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

U = input()

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

Submission status: Accepted

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


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


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

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

Submission status: Accepted

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

Submission status: Accepted

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

a=A
b=B

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

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    s, t = input().split()
    a, b = LI()
    u = input()
    if u == s:
        print("{} {}".format(a - 1, b))
    elif u == t:
        print("{} {}".format(a, b - 1))
    return


# B
def B():
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# 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
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
elif(U == T):
    B -= 1
else:
    print("ERROR")

print(str(A) + ' ' + str(B))

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

dic = {s: A, t: B}
u = input()
dic[u] = dic[u] - 1
print(dic[s], dic[t])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if U==S:
	print('{} {}'.format(A-1, B))
else:
	print('{} {}'.format(A, B-1))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
###########　入力
# 整数の入力
S,T = input().split()
A,B = map(int, input().split())
U = input()

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

###########　出力
print("{} {}".format(A, B))

Submission status: Accepted

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


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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = input().split()
S, T = list(map(int, input().split()))
rem = input()
if rem == ans[0]:
    S -= 1
elif rem == ans[1]:
    T -= 1
print("{} {}".format(S, T))

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

Submission status: Accepted

Solution code:
str1, str2 = input().split()
a, b = map(int, input().split())

u = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s, t = map(int,input().split())

kk = input()

if kk == a:
  s -=1
elif kk == b:
  t -= 1
  
print("{0} {1}".format(s,t))

Submission status: Accepted

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

Submission status: Accepted

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

f = input()

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

# print('---')
# print(s, t)

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

def main():
    balls = {
        S: A,
        T: B
    }

    balls[U] -= 1

    return print(balls[S], balls[T])

main()

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:
# coding: utf-8

red,blue = map(str,input().split())
num1,num2 = map(int,input().split())
u = str(input())

if u==red:
    print(num1-1,num2)
elif u==blue:
        print(num1,num2-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)
else:
    print(A, B)

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

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

print(a,b)

Submission status: Accepted

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

def solve():
    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 __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
def main():
	# import sys
	# input = sys.stdin.readline
	S, T = list(map(str, input().split()))
	A, B = list(map(int, input().split()))
	U = input()
	# print(U)
	if U == S:
		print(A-1, B)
	else:
		print(A, B-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s,t = list(input().split())
a,b = list(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:
def solve():
    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)

solve()

Submission status: Accepted

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

print('{} {}'.format(A - 1, B) if U == S else '{} {}'.format(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().rstrip('\n');

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

print(a,b);

Submission status: Accepted

Solution code:
red , blue = map(str,input().split())
a, b = map(int,input().split())
color = input()

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

Submission status: Accepted

Solution code:
ST = list(input().split())
A, B = map(int, input().split())
U = input()
if U == ST[0]:
    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, sep=" ")
elif U == T:
    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(a,b)

Submission status: Accepted

Solution code:
a, b = input().split(" ")
a_count, b_count = list(map(int, input().split(" ")))
select = input()

if select == a:
  a_count -= 1
elif select == b:
  b_count -= 1
print(str(a_count) + " "+ str(b_count))

Submission status: Accepted

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



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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S, T = map(str,input().split()) # 複数の数字を変数に格納
A, B = map(int,input().split()) # 複数の数字を変数に格納
U = input() # 数字を変数に格納

a = A
b = B

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc154/tasks/abc154_a


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = input().split()
y = input().split()
y = [int(l) for l in y]
U = input()

if U == x[0]:
  y[0] = y[0]-1
else:
  y[1] = y[1]-1

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

Submission status: Accepted

Solution code:
S, T = list(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,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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8 ff=unix


def solv(S, T, A, B, U):
    if S == U:
        A -= 1
    elif T == U:
        B -= 1
    return A, B


if __name__ == "__main__":

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

    print(a1, a2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
string = input()
a, b = map(int, input().split())
splitted = string.split()
u = input()

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

Submission status: Accepted

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

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

print(A,B)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

if U == S:
    A = A - 1

if U == T:
    B = B - 1


print(str(A) + ' ' + str(B))

Submission status: Accepted

Solution code:
c1, c2 = input().split()
a, b = map(int, input().split())
u = input()

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

print(a, b)

Submission status: Accepted

Solution code:
import sys
s,t=(str(i) for i in 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:
import numpy as np

ST=np.array(input().split(" "))
S=ST[0]
T=ST[1]
AB=np.array(input().split(" "),dtype=np.int32)
A=AB[0]
B=AB[1]
U=input()

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

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

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

Submission status: Accepted

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