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:
color1 , color2 = input().split()
num1 , num2 = input().split()
int1 = int(num1)
int2 = int(num2)

dec = input()
if dec == color1:
  int1 -= 1
else:
  int2 -= 1

print("%d %d" %(int1,int2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s,t = input().split()
ans = [int(i) for i in input().split()]
m = input()
if m == s:
  ans[0] -= 1
elif m == t:
  ans[1] -= 1
print(ans[0],ans[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 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:
    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 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)
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:
#!/usr/bin/env python3
import sys


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(A,B)

Submission status: Accepted

Solution code:
items=input().split()
nums=list(map(int, input().split()))
target=input()
if(target==items[0]):
    print(nums[0]-1,nums[1])
else:
    print(nums[0],nums[1]-1)

Submission status: Accepted

Solution code:
source = input().split()
number = input().split()
at = input()

if source[0] == at:
    number[0] = str(int(number[0]) - 1)
else:
    number[1] = str(int(number[1]) - 1)

print(number[0],number[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
else:
  b -= 1
print('{} {}'.format(a, b))

Submission status: Accepted

Solution code:
# 154

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

s, t = sys.stdin.readline().strip().split(" ")
a, b = [int(x) for x in sys.stdin.readline().strip().split(" ")]
u = sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
s,a,u=open(0);i=s.find(u)<1;print(int(a[:2])-i,int(a[2:])-1+i)

Submission status: Accepted

Solution code:
s = input().split()
i = list(map(int, input().split()))
r = input()

if r == s[0]:
  i[0] = i[0] -1
elif r == s[1]:
  i[1] = i[1] -1

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

Submission status: Accepted

Solution code:
a,b=input().split()
a_num,b_num=input().split()
c=input()
 
if c==a:
  a_num=int(a_num)-1
elif c==b:
  b_num=int(b_num)-1
print(a_num,b_num)

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,a,b,u=open(0).read().split();i=u==s;print(int(a)-i,int(b)-1+i)

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:
from collections import OrderedDict
S, T = input().split()
A, B = [int(i) for i in input().split()]
U = input()
dic = OrderedDict(((S, A), (T, B)))
dic[U] -= 1
print(' '.join(map(str, dic.values())))

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:
keys = input().split()
values = tuple(map(int, input().split()))

ball = dict(zip(keys, values))
u = input()

ball[u] -= 1
print(ball[keys[0]], ball[keys[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()
A -= (S == U)
B -= (T == U)

print(A, B)

Submission status: Accepted

Solution code:
import sys


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

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


resolve()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
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
import copy
input = sys.stdin.readline

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

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

Submission status: Accepted

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

if u==li[0]:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

Solution code:
import sys

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

if U == S:
    A -= 1
elif U == T:
    B -= 1
print(' '.join([str(x) for x in [A, B]]))

Submission status: Accepted

Solution code:
import sys

S, T = sys.stdin.readline().split()
A, B = [int(x) for x in sys.stdin.readline().split()]
U = sys.stdin.readline().strip()

if U == S:
    A -= 1
elif U == T:
    B -= 1
print(' '.join([str(x) for x in [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
else:
  b-=1
print(a,b)

Submission status: Accepted

Solution code:
S,T = list(map(str,input().split()))
A,B = list(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=input().split()
aa=int(a)
bb=int(b)
u=input()
if u==s:
    aa=aa-1
elif u==t:
    bb=bb-1
print(aa,"",bb)

Submission status: Accepted

Solution code:
c = input().split()
c1,c2=c[0],c[1]
v=input().split()
v1,v2 = int(v[0]), int(v[1])
f = input()
if f==c1:
    v1-=1
else:
    v2-=1
print(str(v1) + ' ' + str(v2))

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

Submission status: Accepted

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

# 整数の入力
#a = int(input())
# スペース区切りの文字列の入力
st = input().split()
st_list = []
st_list = [str(st) for st in st]

# スペース区切りの数値の入力
a, b = map(int, input().split())

# 文字列の入力
s = input()

# スペース区切りの文字列の入力
#a,b = map(input().split())

if(str(s) == st_list[0]):
  a = a-1
elif(str(s) == st_list[1]):
  b = b-1
# 出力

print(a,b)

Submission status: Accepted

Solution code:
input_data = [input() for i in range(3)]

ball_kinds = input_data[0].split(' ')
ball_counts = [int(i) for i in input_data[1].split(' ')]
target_ball = input_data[2]

for i in range(2):
    if ball_kinds[i] == target_ball:
        ball_counts[i] = ball_counts[i] - 1

print('{} {}'.format(ball_counts[0], ball_counts[1]))

Submission status: Accepted

Solution code:
colors = input().split()
nums= list(map(int, input().split(" ")))
flag = input()

for color, num in zip(colors, nums):
	if flag == color:
		print(num - 1, end = " ") 
	else:
		print(num , end = " ")

Submission status: Accepted

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

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:
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:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 無限 #####
# f_inf = float('inf')

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	ST = input()
	ST = ST[:-1]
	STS = ST.split()
	A,B = inputMap()
	U = input()
	U = U[:-1]

	if U == STS[0]:
		A -= 1
	else:
		B -= 1

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

Submission status: Accepted

Solution code:
import sys

msg = sys.stdin.readlines()
lines = list()

for item in msg:
    if " " in item:
        s, t = item.split()
        lines.append(s)
        lines.append(t)
    else:
        item = item.replace('\n','')
        lines.append(item)

a = int(lines[2])
b = int(lines[3])

if lines[4] == lines[0]:
    a = a - 1
elif lines[4] == lines[1]:
    b = b - 1

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

Submission status: Accepted

Solution code:
strings = input().split()
nums =  list(map(int, input().split(" ")))
delete = input()
for i in range(2):
    nums[i] = (nums[i] -1)  if strings[i] == delete else nums[i]
print(*nums)

Submission status: Accepted

Solution code:
# coding: utf-8
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:
A=input().split()
B=list(map(int,input().split()))
C=input()
if C==A[0]:
  B[0]=B[0]-1
else:
  B[1]=B[1]-1
print(B[0], 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:
S,T = input().split()
A,B = input().split()
U = input()
A,B = int(A), int(B)

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

print(A , " " , B)

Submission status: Accepted

Solution code:
X,Y = input().split()
A,B = map(int,input().split())
C = input()
if(X==C):
    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 U == S:
    print(A-1, B)
else:
    print(A, B-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
S, T = input().split(" ")
A, B = map(int, input().split(" "))
U = input()
if T == U:
    print(A, B-1)
else:
    print(A-1, B)

Submission status: Accepted

Solution code:
a = [input() for i in range(3)]
x,y = map(str,a[0].split())
b,c = map(int,a[1].split())

if x == a[2]:
    b -= 1
    print(b,c)
else:
    c -= 1
    print(b,c)

Submission status: Accepted

Solution code:
import numpy as np
s,t=(x for x in input().split())
a,b=(int(x) for x in input().split())
u=input()

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

print(a,b,sep=" ")



"""
cd C:/Users/muto/Documents/AtCorder
python


入力
文字列
s=input()
整数
a=int(input())
区切り文字
b,c=(int(x) for x in input().split())

任意の文字数
a = int(input())
b=np.array(a)
b=(int(x) for x in input().split())
c=list(b)

2重ループを抜ける
flag=False
	else:
            flag=True
            break
    if flag:
        break

整数型int
小数型float

出力、区切り文字
print(str(a+b+c),s,sep=" ")
print('Odd')

if文
if a%2==1 and b%2==1:
else:

行列操作
b=np.array(a)
c[i]=int(c[i]/2)


import math
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

#関数定義
def test():
    print('関数：testを呼び出しました')
 
if __name__ == '__main__':
 
    print('python-izm')
    test()

#配列
arr = np.asarray([1,2,3], dtype=np.int32)
np.float64
np.array(range(1, 10))

#行列
arr = np.asarray([[1,2,3], [4,5,6]])
np.zeros((2, 3))

#乱数発生
np.random.rand(2, 3)
np.random.randint(0, 10, size=10)

np.zeros((2, 3))
np.random.shuffle(x)

#行列積
a.dot(b)
np.dot(vecx, vecz)

#各要素ごとの積
np.multiply(x,y)

#結合
np.vstack((x, y))

#平均最大値最小値標準偏差和
np.mean(arr)
np.max(arr)
np.min(arr)
np.std(arr)
np.sum(arr)
np.sqrt
#列ごと
np.sum(arr, axis=0)
#行ごと
np.sum(arr, axis=1)

#ソート
print(np.sort(x)[::-1])

#各値（0始まり）
x[0][1] = 100

#転地行列
arr.T

#画面表示
import tkinter
root = tkinter.Tk()

#リストでグラフ作成
plt.plot([3,4,2,1])
plt.ylabel('some numbers')
plt.show()

#点でグラフ（範囲指定）
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()

#関数でグラフ
x = np.arange(0., 5., 0.2)
plt.plot(x**3, 'b--')
plt.show()

#複数グラフ
plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
plt.show()

#関数定義
def f(t):
    return t
 
t = np.arange(0., 5., 0.2)
 
plt.plot(t, f(t), 'r--', t, g(t), 'bs', t, h(t), 'g^')
plt.show()

#タブ区切りファイルからグラフ作成
with open("Input.txt", 'r') as inputfile:
    lines = inputfile.readlines()
    x = []
    y = []
    for line in lines:
        value = line.replace('\n', '').split('\t')
        x.append(value[0])
        y.append(value[1]) 
    plt.plot(x, y)
    plt.show()

#png出力
plt.savefig('hoge.png', dpi=300, orientation='portrait', transparent=False, pad_inches=0.0)

#pdf出力
plt.savefig('test.pdf', orientation='portrait', transparent=False, bbox_inches=None, frameon=None)

#utf-8表記（python2で必要）
# -*- coding: utf-8 -*- 

"""

Submission status: Accepted

Solution code:
a = input().split()
b = list(map(int,input().split()))
u = input()
for i,j in enumerate(a):
	if j == u:
		b[i] -= 1
print(*b)

Submission status: Accepted

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

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

Submission status: Accepted

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

# Input
s = [input() for i in range(3)]
ST = list(s[0].split())
S = str(ST[0])
T = str(ST[1])

AB = list(s[1].split())
A = int(AB[0])
B = int(AB[1])

U = str(s[2])


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

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

Submission status: Accepted

Solution code:
sName, tName = map(str, input().split())
sNum, tNum = map(int, input().split())
uName = input()

if uName == sName:
    sNum = sNum - 1
elif uName == tName:
    tNum = tNum - 1

print("{} {}".format(sNum, tNum))

Submission status: Accepted

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

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("{} {}".format(A,B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target_a, target_b = list(map(str, input().split()))
a, b = map(int, input().split())
target = input('')
list_target_a = list(target_a)
list_target_b = list(target_b)
list_target = list(target)
a_ans = 0
b_ans = 0
if len(list_target) == len(list_target_a):
    for i in range(len(list_target_a)):
        if list_target[i] == list_target_a[i]:
            a_ans += 1

if a_ans == len(list_target_a):
    a -= 1

if len(list_target) == len(list_target_b):
    for i in range(len(list_target_b)):
        if list_target[i] == list_target_b[i]:
            b_ans += 1

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

print(a,b)

Submission status: Accepted

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

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)


    return 

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin

s, t = stdin.readline().rstrip().split()
a, b = [int(x) for x in stdin.readline().rstrip().split()]
u = stdin.readline().rstrip()

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

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

Submission status: Accepted

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

s = A
t = B

if U == S:
  s -= 1
else:
  t -= 1

print(s, t)

Submission status: Accepted

Solution code:
color = input().split()
 
num = input().split()

stock = {}
stock[color[0]] = num[0]
stock[color[1]] = num[1]
 
u = input().split()
 
stock[u[0]] = int(stock[u[0]]) - 1
 
print('{col1} {col2}'.format(col1=stock[color[0]],col2=stock[color[1]]))

Submission status: Accepted

Solution code:
inputlist=input().split()
s=inputlist[0]
t=inputlist[1]

aaa=input()
b=aaa.split(sep=" ")
c=list(map(int, b))

new_dict={}
new_dict[s]=c[0]
new_dict[t]=c[1]

inputfruit  =   input()
if inputfruit==s:
    ans = new_dict[s]-1
    new_dict[s] = ans
else:
    ans = new_dict[t]-1
    new_dict[t]=ans

sonoichi =new_dict[s]
sononi  =   new_dict[t]
print(sonoichi, sononi)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
S, T = map(str, stdin.readline().rstrip().split())
A, B = map(int, stdin.readline().rstrip().split())
U = str(stdin.readline().rstrip())
if S == U:
    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 U == S:
  print(a-1,b)
else:
  print(a,b-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
c = input().split()
n = input().split()
u = input()
if c[0] == u:
	n[0] = str(int(n[0])-1)
else:
  	n[1] = str(int(n[1])-1)
print(' '.join(n))

Submission status: Accepted

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

dic = {}
dic[S] = A
dic[T] = B
U = input()
dic[U] -= 1

print(str(dic[S]) + " " + str(dic[T]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# それぞれのボールの文字列を取得
a, b = input().split()

# それぞれのボールの個数を取得
aCount, bCount = input().split()
aNumber = int(aCount)
bNumber = int(bCount)

ball = []
ball.append(aNumber)
ball.append(bNumber)

# 取り出したボールの文字列を取得
selectBall = input()

if selectBall == a:
    aNumber = aNumber-1
    ball[0] = aNumber
    print(' '.join(map(str,ball)))
elif selectBall == b:
    bNumber = bNumber-1
    ball[1] = bNumber
    print(' '.join(map(str,ball)))
else:
    print(' '.join(map(str,ball)))

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

Submission status: Accepted

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

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

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:
a = list(input().split())
b = list(map(int, input().split()))
e = a
f = b
c = input()
d = {key: val for key, val in zip(e, f)}
d[c] -= 1
print(d[a[0]], d[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 = 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 sys

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

print(A, B)

Submission status: Accepted

Solution code:
l = [input().split() for i in range(3)]
STl = l[0]
ABl = l[1]
Ul = l[2]
U = Ul[0]

ABl[STl.index(U)] = str(int(ABl[STl.index(U)]) - 1)
print(' '.join(ABl))

Submission status: Accepted

Solution code:
n,m = input().split()
r,b = map(int,input().split())
t = input()
if n == t:
  print(str(r-1) + ' ' + str(b))
else:
  print(str(r) + ' ' + str(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 = map(str, input().lower().split())
a, b = map(int, input().lower().split())
u = input()
dicts = {}
dicts.update([(s,a),(t,b)])
dicts[u] = dicts[u] - 1
print("%d %d" %(dicts[s], dicts[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:
# -*- coding: utf-8 -*-
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:
input_list = input().split()
input_list2 = list(map(int, input().split()))
delete_ball = input()
for ind, n in enumerate(input_list):
  if n == delete_ball:
    input_list2[ind] -= 1
ans = ""
for m in input_list2:
  ans += str(m) + " "
print(ans.rstrip())

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

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

d = {}
d[s] = a
d[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(str(a)+" "+str(b))

Submission status: Accepted

Solution code:
ss = input()
ll = ss.split()
s = ll[0]
t = ll[1]
aa = input()
lll = aa.split()
a = int(lll[0])
b = int(lll[1])
uu = input()
if uu == s:
    a = a-1
else:
    b = b-1
print(a,end = " ")
print(b)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a = input().split()
b = list(map(int,input().split()))
c = input()
x=int(a.index(c))
y=int(b[x])
del b[x]
u=y-1
b.insert(x,u)
print(*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:
a,b=input().split()
A,B=map(int,input().split())
c=input()
if a==c:
  A=A-1
else:
  B=B-1
print(A,B)

Submission status: Accepted

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

 
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('{} {}'.format(A-1,B))
if U== T:
    print('{} {}'.format(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:
# 入力
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:
   a-=1
else:
	b-=1
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:
    A -=1
elif T == U:
    B -=1
else:
    pass

print(A,B)

Submission status: Accepted

Solution code:
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

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

s,t = list(map(str, 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 = input().split()
U = str(input())
if(U == S):
   A = int(A) - 1
elif(U==T):
    B = int(B) -1
print(A, B)

Submission status: Accepted

Solution code:
st = input().split()
ab = input().split()
u = input()
if u == st[0]:
 print(int(ab[0])-1,int(ab[1]))
else:
 print(int(ab[0]),int(ab[1])-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(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 = map(str, input().split())
c,d = map(int, input().split())
e = input()
if e == a:
  c-=1
else:
  d-=1
print('%s %s' % (c, d))

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