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:
a,b = input().split()
s,t = input().split()
c = input()

if (a == c):
  s = int(s) - 1
else:
  t = int(t) - 1

print(str(s) + " " + str(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 = input().split()
s2 = input().split()
s3 = input()

if s3 == s[0]:
    ss = int(s2[0]) - 1
    print(str(ss) + " " + s2[1])
else:
    ss = int(s2[1]) - 1
    print(s2[0] + " " + str(ss))

Submission status: Accepted

Solution code:
red,blue = input().split()
r,b = map(int,input().split())
u = input()
if u == red:
    print(r-1, b)
else:
    print(r, 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:
def func():
    return

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

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

print("%d %d"%(a, b))

Submission status: Accepted

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

y = input().split()
a = int(y[0])
b = int(y[1])

u = input()

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

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

Submission status: Accepted

Solution code:
s,t = map(str,raw_input().strip().split())
dic = {}
a,b = map(int,raw_input().strip().split())
dic[s] = a
dic[t] = b
u = raw_input()
dic[u] = dic[u]-1
print("%d %d"%(dic[s],dic[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,T = list(map(str,input().split()))
A,B = list(map(int,input().split()))
U = input()


if U == S:
    print(max(A-1,0),B)
elif U == T:
    print(A,max(B-1,0))
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(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 = 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:
#n = int(input())
s,t = map(str,input().split())
a,b = map(int,input().split())
u = input()

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

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:
c1 ,c2 = map(str,input().split())
n1 ,n2 = map(int,input().split())
u = str(input())

if u == c1:
    n1 = n1 - 1
else:
    n2 = n2 - 1

print("{} {}".format(n1,n2))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

Solution code:

line = input().split(" ")
S, T = line
line = input().split(" ")
A, B = int(line[0]), int(line[1])
U = input()

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

print(A, B)

Submission status: Accepted

Solution code:
s=input()
t=list(map(int,input().split()))
u=input()
v=s.split()
for i in range(2):
  if v[i]==u:
    t[i]-=1
print(*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:
# A - Remaining Balls

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 = 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=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
# Your code here!
 
S,T = [i for i in input().split()]
A,B = [int(i) for i in 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(str(a) + " " + str(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()
ans1 = A
ans2 = B
if S==U:
    ans1 -= 1
else:
    ans2 -= 1
print(ans1, ans2)

Submission status: Accepted

Solution code:
chr_list = input().split()
number_list = list(map(int, input().split()))
chr = input()

ch_dict = {}
for each_ch, number in zip(chr_list, number_list):
    ch_dict[each_ch] = number

ch_dict[chr] = ch_dict[chr] - 1

for each_ch in chr_list:
    print(ch_dict[each_ch], end="")
    print(" ", end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
col = input().split()
ball = list(map(int, input().split()))
choice = input()

if col[0] == choice:
  ball[0] = ball[0] - 1
else:
  ball[1] = ball[1] - 1

print(str(ball[0]) + " " + str(ball[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(str(a) + " " + str(b))

Submission status: Accepted

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

if S[0]==N:
  A[0]-=1
else:
  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 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 s == u:
  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 s == u:
  a -= 1
else:
  b -= 1
print(str(a) + " " + str(b))

Submission status: Accepted

Solution code:
import re

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

m = re.match(u, s)
if m is None:
    m = re.match(u, t)
    if m is not None:
        b -= 1
else:
    a -= 1

print(a, b)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

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

    index = [S, T].index(U)
    if index == 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())
N = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P = [str(p) for p in input().split()]
S = P[0]
T = P[1]

Q = [int(q) for q in input().split()]
A = Q[0]
B = Q[1]

U = str(input())

if(U == S):
    A = A - 1
if(U == T):
    B = 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:
    a -= 1
elif u == t:
    b -= 1
else:
    pass
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 s == u:
  a = a-1
elif t == u:
  b = 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
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 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()
if(str(S)==str(U)):
  A=int(A)-1
if(str(T)==str(U)):
  B=int(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(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:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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
    solve(S, T, A, B, U)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

if u == s:
    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:
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:
T = input().split(" ")
s = T[0]

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:
#import numpy as np
from sys import stdin
from copy import deepcopy
from functools import reduce
from fractions import gcd
import math
import itertools
from collections import Counter
from itertools import chain  ##list(chain.from_iterable(l)) ##flatten
from heapq import heappush, heappop

"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

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:
first = input().split(' ')
second = input().split(' ')

name_1 = first[0]
count_1 = int(second[0])
name_2 = first[1]
count_2 = int(second[1])

name = input()

if name_1 == name:
    count_1 -= 1
else:
    count_2 -= 1

print(count_1, count_2)

Submission status: Accepted

Solution code:
input_first = input().split()
input_second = input().split()
S = input_first[0]
T = input_first[0]
A = input_second[0]
B = input_second[1]

A = int(A)
B = int(B)

input_U = input()

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

Submission status: Accepted

Solution code:
ST = input().split(" ")
A, B = map(int, input().split())
U = input()

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


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

Submission status: Accepted

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

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


if __name__ == '__main__':
    inputs = read()
    print("{} {}".format(*solve(*inputs)))

Submission status: Accepted

Solution code:
from sys import stdin

if __name__ == '__main__':
    S, T = stdin.readline().rstrip().split()
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    U = stdin.readline().rstrip()
    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 s==u:
  a-=1
elif t==u:
  b-=1
print(a,b)

Submission status: Accepted

Solution code:
def main():
	s = list(map(str,input().split()))
	a = list(map(int,input().split()))
	u = str(input())
	#List=list(map(int,input().split()))
	
	a[s.index(u)] -= 1
 
	print(' '.join(map(str, a)))
 
	
 
if __name__ == '__main__':
	main()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

u = str(input())

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

Submission status: Accepted

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

    if ss == s:
        print(str(a-1) + ' ' + str(b))
        return
    else:
        print(str(a) + ' ' + str(b-1))
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
#python3
s, t = map(str, 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, end=" ")

Submission status: Accepted

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

input_a = input().split()
a = int(input_a[0])
b = int(input_a[1])

u = input()

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

result = str(a)+" "+str(b)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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])

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
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('{} {}'.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):
  a -= 1
elif (u == t):
  b -= 1

print(a, b)

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

Solution code:
strS,strT = input().split()
intA,intB = map(int,input().split())
strU = input()

if strU == strS:
    intA -= 1
elif strU == strT:
    intB -= 1
print(intA,intB)

Submission status: Accepted

Solution code:
def main():
    hoge = input().split()
    huga = list(map(int, input().split()))
    poyo = input()
    if hoge[0] == poyo:
        huga[0] = huga[0] -1
    else:
        huga[1] = huga[1] -1
    print(huga[0],huga[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(" ")
S_num, T_num = input().split(" ")
S_num = int(S_num)
T_num = int(T_num)
U = input()
if S == U:
  print(str(S_num-1)+ " "+str(T_num) )
if T == U:
  print(str(S_num)+ " "+str(T_num-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()
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 = A - 1
elif T == U:
    B = B - 1

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

Submission status: Accepted

Solution code:
ball = input().split(" ")
S = str(ball[0])
T = str(ball[1])
ball_number = input().split(" ")
A = int(ball_number[0])
B = int(ball_number[1])
U = str(input())
if U == S:
	A -= 1
else:
	B -= 1
print(str(A) + " " + str(B))

Submission status: Accepted

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

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

if r == s:
  A[0] -= 1
elif r == t:
  A[1] -= 1
print(A[0],A[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
if U == T:
  B = B-1

print(A,B)

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
l = input().split()
s,t = l[0],l[1]
a ,b = i2()
u = input()
if s == u:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

Solution code:
color = input().split()
num = list(map(int,input().split()))
c = input()
if c == color[0]:
    num[0] -= 1
else:
    num[1] -= 1
print(str(num[0])+" "+str(num[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 = 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())
A,B = map(int, input().split())
U=input()
if U==S:
    A-=1
else:
    B-=1
print(A, end=" ")
print(B)

Submission status: Accepted

Solution code:
S, T = [i for i in input().rstrip().split(' ')]
A, B = [int(i) for i in input().rstrip().split(' ')]
U = input().rstrip().split(' ')[0]
print(A-1, B) if S == U else print(A, B-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''


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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

S, T = map(str, 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:
s,t=(i for i in input().split())
n,m=(int(i) for i in input().split())
u=input()
if u==s:
  n-=1
elif u==t:
  m-=1
print(n,m)

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 = [x for x in input().split()]
A, B = [int(x) for x in 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 main():
    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)


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 = 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:
import sys


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def eprint(s):
    if type(s) != type('str'):
        s=str(s)

    sys.stderr.write(s+'\n')
    return

def main():
    s,t = input().split()
    a,b  = map(int, input().split())
    u = input().split('\n')[0]
    
    if s==u:
        print(a-1,b)
    else:
        print(a, b-1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import sys
readline = sys.stdin.readline
read = sys.stdin.read


#n,k,*p = [int(i) for i in read().split()]
s,t,a,b,u = read().split()

a,b = int(a),int(b)

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

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

Submission status: Accepted

Solution code:
# import numpy as np
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 = 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:
  print("{} {}".format(a-1,b))
elif u==t:
  print("{} {}".format(a,b-1))

Submission status: Accepted

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

answer = []

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

ab_list[n_list.index(u)] = ab_list[n_list.index(u)] - 1
ans = " ".join([str(x) for x in ab_list])

print(ans)