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: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
print('x' * len(s))

Submission status: Wrong Answer

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

result_dict = {S: A, T: B}
result_dict[U] -= 1
print(" ".join(map(str, result_dict.values())))

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])
 
def main():
    s,t = inpls()
    a,b = inpm()
    u = str(input())
    if s==u:
        print(a-1)
        print(b)
    else:
        print(a)
        print(b-1)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])
 
def main():
    s,t = inpls()
    a,b = inpm()
    u = str(input())
    if s==u:
        ans = [str(a-1),str(b)]
        print(' '.join(ans))
    else:
        ans = [str(a),str(b-1)]
        print(' '.join(ans))
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])
 
def main():
    s,t = inpls()
    a,b = inpm()
    u = str(input())
    if s==u:
        print(a-1,b)
    else:
        print(a,b-1)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()
print('x' * len(s))

Submission status: Wrong Answer

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: Wrong Answer

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

ans = A + B

if S == U or T == U:
    ans -= 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
 
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: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
 
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: Wrong Answer

Solution code:
word = input()
list_ = ([i for i in word])
for i in range(len(list_)):
  list_[i] = 'x'
print(''.join(list_))

Submission status: Wrong Answer

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

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: Wrong Answer

Solution code:
input1 = input()
s = str(input1).split(' ')[0]
t = str(input1).split(' ')[1]
input2 = input()
a = int(str(input2).split(' ')[0])
b = int(str(input2).split(' ')[1])
u = str(input())
if s == t:
  a = a - 1
else:
  b = b - 1
print(a, ' ', b)

Submission status: Wrong Answer

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

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: Wrong Answer

Solution code:
red,blue=input().split()
a,b=list(map(int,input().split()))
s = input()
if s == "red":
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Wrong Answer

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

if U == 'red':
    A -= 1
else:
    B -= 1

print(A,B)

Submission status: Wrong Answer

Solution code:
S = ['red', 'blue']
T = [3, 4]
U = 'red'

if U == 'red':
  print(T[0]-1, T[1])
elif U == 'blue':
  print(T[0], T[1]-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
st = input().split()
kazu = list(map(int, input().split()))
u = input()
a = {st[0]: kazu[0], st[1]: kazu[1]}
a[u] -= 1
a = list(a.values())
print(a[0], a[1])

Submission status: Wrong Answer

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

if s == u:
	print(a-1)

else:
	print(b-1)

Submission status: Wrong Answer

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

if s == u:
	print(a-1)

else:
	print(b-1)

Submission status: Wrong Answer

Solution code:
import sys

def main():

    # sys.stdin = open("input154a.txt")

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

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    s, t = input().split()
    a, b = map(int, input().split())
    u = input()
    if s == u:
        a = max(0, a-1)
    else:
        b = max(0, a-1)

    print(a, b)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    d = collections.defaultdict(int)
    st = list(map(str, str(input().rstrip('\n')).split()))
    ab = list(map(str, str(input().rstrip('\n')).split()))
    for s, v in zip(st, ab):
        d[s] = int(v)
    d[str(input().rstrip('\n'))] -= 1
    print(*d.values())


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    st = list(map(str, str(input().rstrip('\n')).split()))
    ab = list(map(str, str(input().rstrip('\n')).split()))
    d = {s: int(v) for s, v in zip(st, ab)}
    d[str(input().rstrip('\n'))] -= 1
    print(*d.values())


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S, T = input().split()
s, t = map(int, input().split())
U = input()
dic = {S:s, T:t}
dic[U] -= 1
print([num for num in dic.values()])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S, T = input().split()
A, B = [int(i) for i in input().split()]
U = input()
dic = {S: A, T: B}
dic[U] -= 1
print(' '.join(map(str, dic.values())))

Submission status: Wrong Answer

Solution code:
import sys


input = sys.stdin.readline

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: Wrong Answer

Solution code:
import sys


def resolve():
    input = sys.stdin.readline

    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: Wrong Answer

Solution code:
colors = input().split()
numbers = list(map(int, input().split()))
picked_color = input()

dic = dict(zip(colors, numbers))
ans = ""

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans = ans + str(number) + " "
        
print(ans.strip())

Submission status: Wrong Answer

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

def main():
    N, *A = read().split()
    for a in A:
        if A.count(a)==1:
            continue
        else:
            result = 'NO'
            return result
    else:
        result = 'Yes'
    return result

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

Submission status: Wrong Answer

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

if U == 'red':
    A = A - 1
else:
    B = B - 1

print(A,B)

Submission status: Wrong Answer

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

dict = {S: A, T: B}
if (dict[U] != 0):
    dict[U] = dict[U] - 1

values = []
for k, v in dict.items():
    values.append(v)

print(' '.join(map(str, values)))

Submission status: Wrong Answer

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

dict = {S: A, T: B}
dict[U] = dict[U] - 1

values = []
for k, v in dict.items():
    values.append(v)

print(' '.join(map(str, values)))

Submission status: Wrong Answer

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

dict = {S: A, T: B}

dict[U] = dict[U] - 1

values = []
for k, v in dict.items():
    print(v, end="")

Submission status: Wrong Answer

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

dict = {S: A, T: B}

dict[U] = dict[U] - 1

values = []
for k, v in dict.items():
    print(v, end=" ")

Submission status: Wrong Answer

Solution code:
# 入力された文字列をすべてxで置き換える

# 文字列の標準入力
s = input()
sLength = len(s)
hoge = []

for i in range(sLength):
    c = s[i]
    c = "x"
    hoge.append(c)

print(''.join(map(str,hoge)))

Submission status: Wrong Answer

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

if u == "red":
    if s == "red" and t == "red":
        print(int(a-1),int(b-1))
    elif s == "red":
        print(int(a-1),b)
    elif t == "red":
        print(a,int(b-1))
    else:
        print(a,b)
else:
    if s == "blue" and t == "blue":
        print(int(a-1),int(b-1))
    elif s == "blue":
        print(int(a-1),b)
    elif t == "blue":
        print(a,int(b-1))
    else:
        print(a,b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if s == "red":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif s == "blue":
    if u == "blue":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
elif s == "red" and t == "red":
    if u == "red":
        print(int(a-1),int(b-1))
    else:
        print(a,b)
elif s == "blue" and t == "blue":
    if u == "blue":
        print(int(a-1),int(b-1))
    else:
        print(a,b)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
A=input().split()
B=list(map(int,input().split()))
C=input()
if C=='red':
  B[0]=B[0]-1
else:
  B[1]=B[1]-1
print(B[0],B[1])

Submission status: Wrong Answer

Solution code:
S = len(input())
cnt = "x"
length = 0
a = "x"
while S != length:
    cnt = cnt + a
    length = len(cnt)
print(cnt)

Submission status: Wrong Answer

Solution code:
A=input().split()
B=list(map(int,input().split()))
B=list(map(lambda x:x-1,B))
print(B[0],B[1])

Submission status: Wrong Answer

Solution code:
S=input()
word="S"
print(word.replace("S","X")*len(S))

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
A = len(S)
B = len(T)
U = input()
if U==S:
    A -= 1
if U == T :
    B -= 1
print(A," ",B)

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

r = ""
for i in range(len(s)):
    r += "x"

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if U == "red":
    A = A - 1
else:
    B = B - 1

print(A, B)

Submission status: Wrong Answer

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().split()

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


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

Submission status: Wrong Answer

Solution code:
S, a = input(), ""
for x in range(len(S)):
    a += "x"
print(a)

Submission status: Wrong Answer

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().split()

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


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

Submission status: Wrong Answer

Solution code:
U = input('').split()
s = input('').split()
a = input('')
for i in range(0,len(U)):
    print(U[i])
for i in range(0,len(s)):
    s[i] = int(s[i])

for i in range(0,len(U)):
    if a == U[i]:
        s[i] += -1
        
print(s)

Submission status: Wrong Answer

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

if (s in "red") == True:
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif (s in "blue") == True:
    if u == "red":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
elif (s in "red" and t in "red") == True:
    if u == "red":
        print(int(a-1),int(b-1))
    else:
        print(a,b)
elif (s in "blue" and t in "blue") == True:
    if u == "blue":
        print(int(a-1),int(b-1))
    else:
        print(a,b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S, a = input(), ""
for x in range(len(S)):
    a += "x"
print(a)

Submission status: Wrong Answer

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

print(s,t,a,b,u)

if u == s:
	a= a-1

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

Submission status: Wrong Answer

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

if u.__eq__(s):
    print(a-1)
else:
    print(b-1)

Submission status: Wrong Answer

Solution code:
import re
i = input()
print(re.sub('[abcdefghijklmnopqrstuvwyz]', 'x',i))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import random
list1=[0,1,2,3,4,5,6,7,8,9]
list2=[0,1,2,3,4,5,6,7,8,9]
a = random.randint(0,9)
b = random.randint(0,9)
print(list1[a], list2[b])

Submission status: Wrong Answer

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

if s == "red" and t == "blue":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif s == "blue" and t == "red":
    if u == "blue":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
else:
    print(int(a-1), int(b-1))

Submission status: Wrong Answer

Solution code:
S = "red"
T = "blue"
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: Wrong Answer

Solution code:
colors = input().split()
numbers = list(map(int, input().split()))
picked_color = input()

dic = dict(zip(colors, numbers))
ans = ""

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans = ans + str(number) + " "
        
print(ans.rstrip())

Submission status: Wrong Answer

Solution code:
colors = input("Color: ").split()
numbers = list(map(int, input("Number: ").split()))
picked_color = input("Pick: ")

dic = dict(zip(colors, numbers))
ans = ""

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans = ans + str(number) + " "
        
print(ans.rstrip())

Submission status: Wrong Answer

Solution code:
colors = input("Color: ").split()
numbers = list(map(int, input("Number: ").split()))
picked_color = input("Pick: ")

dic = dict(zip(colors, numbers))
ans = list()

for color, number in dic.items():
    if color == picked_color:
        number -= 1
    ans.append(number)
        
print(' '.join(str(n) for n in ans))

Submission status: Wrong Answer

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

if s == "red" and t == "blue":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
elif s == "blue" and t == "red":
    if u == "red":
        print(a,int(b-1))
    else:
        print(int(a-1),b)
else:
    print(int(a-1), int(b-1))

Submission status: Wrong Answer

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

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

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

    print(A, B)


main()

Submission status: Wrong Answer

Solution code:
def func():
    colors = input("Color: ").split()
    numbers = list(map(int, input("Number: ").split()))
    picked_color = input("Pick: ")
    
    dic = dict(zip(colors, numbers))
    ans = list()
    for color, number in dic.items():
        if color == picked_color:
            number -= 1
        ans.append(number)

    return ' '.join(str(n) for n in ans)

Submission status: Wrong Answer

Solution code:
r,b = input().split()
num1,num2 = map(int,input().split())
u = input()
a = 0
b = 0
if u == r:
    a = num1-1
else: 
    a = num1
if u == b:
    b = num2-1
else: 
    b = num2
print(a,b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()
print('x'* len(S))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
m = ""
for i in s:
    m = m + i.replace(i, 'x')
print(m)

Submission status: Wrong Answer

Solution code:
N=input()
A=input().split()
if(sorted(set(A), key=A.index)==A):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
d1 = input().split()
d = input().split()
d3 = input()
d2 = [int(x) for x in d]

if d1[0]==d3:
    d2[0]-=1
elif d1[1]==d3:
    d2[1]-=1

print("d2[0],d2[1]")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# 154

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()

A = len(S)
B = len(T)

U = input()

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

print(A, B)

Submission status: Wrong Answer

Solution code:
a,b = input().split()
A,B = input().split()
c = input()
a = str(a)
b = str(b)
A = int(A)
B = int(B)
c = str(c)
d = A - 1
D = B - 1
if c == a:
    print(d,B)
elif c == b:
    print(D,A)

Submission status: Wrong Answer

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

if s == "reb" and t == "blue":
    if u == "red":
        print(int(a-1),b)
    else:
        print(a,int(b-1))
else:
    if u == "blue":
        print(a,int(b-1))
    else:
        print(int(a-1),b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = input().split()
A,B = input().split()
c = input()
a = str(a)
b = str(b)
A = int(A)
B = int(B)
c = str(c)
d = A - 1
D = B - 1
if c == a:
    print(d)
elif c == b:
    print(D)

Submission status: Wrong Answer

Solution code:
ball = dict(zip(input().split(), map(int, input().split())))
u = input()

ball[u] -= 1
print(" ".join(map(str, ball.values())))

Submission status: Wrong Answer

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("{} {}".format(s, t))
print("{} {}".format(a,b))

Submission status: Wrong Answer

Solution code:
s = input().split()
i = list(map(int, input().split()))
a=input()
if a==s[0]:
  i[0]-=1
elif a==s[1]:
  i[1]-=1
print(i)

Submission status: Wrong Answer

Solution code:
tmp = input().split()
S = tmp[0]
T = tmp[1]
i = list(map(int, input().split()))
A = i[0]
B = i[1]
U = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
tmp = input().split()
S = tmp[0]
T = tmp[1]
i = list(map(int, input().split()))
A = i[0]
B = i[1]
U = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split()
n = input().split()
c = input()
b = 0
d = 0
if c is a[0]:
    b =int(n[0])-1
else:
    d =int(n[1])-1
print(b,d)

Submission status: Wrong Answer

Solution code:
tmp = input().split()
S = tmp[0]
T = tmp[1]
i = list(map(int, input().split()))
A = i[0]
B = i[1]
U = input()

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

Submission status: Wrong Answer

Solution code:
import sys
a,b=map(str, sys.stdin.readline().split())
c,d=map(int, sys.stdin.readline().split())
e=sys.stdin.readline()
if a==e:
  c-=1
else:
  d-=1
print(c,d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if u == "red":
    print(int(a-1),b)
else:
    print(a,int(b-1))

Submission status: Wrong Answer

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

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

print(a, b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(input(),input())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S[0] == Z:
  X = A[1]
  Y = A[0] - 1
if S[1] == Z:
  X = A[0]
  Y = A[1]-1
  
print("{} {}".format(X, Y))

Submission status: Wrong Answer

Solution code:
word_list = [i for i in input().split()]
num_list = [int(num) for num in input().split()]
ext_word = input()

check_dict = dict(zip(word_list, num_list))

if ext_word in word_list:
    check_dict[ext_word] -= 1
else:
    pass

check_dict = [str(i) for i in check_dict.values()]
print(check_dict[0] + " " + check_dict[1])

Submission status: Wrong Answer

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

print(C)

Submission status: Wrong Answer

Solution code:
S_T=input("S T:")
A_B=input("A B:")
U=input("U:")
list_S_T=[]
for i in range(len(S_T)):
    if S_T[i]==" ":
        S =S_T[0:i]
        T=S_T[i+1:len(S_T)]
for i in range(len(A_B)):
    if A_B[i]==" ":
        A = int(A_B[0:i])
        B = int(A_B[i+1:len(A_B)])
if S==U:
    A = A-1
elif T==U:
    B = B-1
print(A,B)

Submission status: Wrong Answer

Solution code:
s = input()

s_len = len(s)
result = ''
while True:
    result += 'x'
    if len(result) == s_len:
        break

print(result)

Submission status: Wrong Answer

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

print(C)
print(S,T,A,B,U)

Submission status: Wrong Answer

Solution code:
input_str = input().split()
input_int = list(map(int, input().split()))
input_line = input()

input_dict = {}

input_dict[input_str[0]] = input_int[0]
input_dict[input_str[1]] = input_int[1]

input_dict[input_line] = input_dict[input_line] - 1

for i in input_dict:
    print(input_dict[i],end=' ')

Submission status: Wrong Answer

Solution code:
ST = input()
A, B = map(int, input().split())
U  = input()
S=ST[0]
T=ST[1]


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

print(A,'',B)

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline
    
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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)

if len(list_target) == len(list_target_a):
    a -= 1
if len(list_target) == len(list_target_b):
    b -= 1

print(a, b)