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:
s,t = map(str,input().split())

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

u = input()

if s == u:
    print(a-1)
    print(b)
else:
    print(a)
    print(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(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().strip().split()
A, B = map(int, input().split())
U = input().strip()

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:
    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,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:
#!/usr/bin/env python3
import sys


def solve(S: str, T: str, A: int, B: int, U: str):
    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, u = input().split()
sc, uc = map(int,input().split())
u = input()

if u == s:
  sc -= 1
else:
  uc -= 1

print(sc, uc)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S,T = [s for s in input().split()]
A,B = [int(s) for s in input().split()]
U = input()
if S == U:
    A-=1
else:
    B-=1
print("%d %d" % (A,B))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s, t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if u == s:
    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:
# coding: utf-8
# Your code here!
# coding: utf-8
from fractions import gcd 
from functools import reduce
import sys
sys.setrecursionlimit(200000000)
from inspect import currentframe


# my functions here!
#標準エラー出力
def printargs2err(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' : '+repr(arg) for arg in args),file=sys.stderr)
def debug(x):
    print(x,file=sys.stderr)
def printglobals():
    for (symbol, value) in globals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
def printlocals():
    for (symbol, value) in locals().items():
        print('symbol="%s"、value=%s' % (symbol, value),file=sys.stderr)
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
def worstdata():
    a=0
    return a
#solution:
def comp(x,y):
    dp=[0,max(act[0])]*(N+1) #[i]日目のActivity で得られる最大幸福量
    
    return 0

#input
S,T=pin(str)
A,B=pin()
U=input()
if U==S:
    A-=1
else:
    B-=1
print(A,B)
#print(solution(H,N))
#print(["No","Yes"][cond])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A
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:
from sys import stdin
s,t = [x for x in stdin.readline().rstrip().split()]
a,b = map(int,stdin.readline().rstrip().split())
k = stdin.readline().rstrip()
if k == s:
    print(a-1,b)
elif k == t:
    print(a,b-1)
else:
    print(a,b)

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools

#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]



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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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(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:
import sys
s, t  = [i for i in sys.stdin.readline().strip().split()]
a, b = [int(i) for i in sys.stdin.readline().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()
sint, tint = map(int, input().split())
temp = input()
if temp == s:
    sint-=1
else:
    tint-=1
print(sint, tint)

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

if a == s:
    print(red-1, blue)
else:
    print(red, blue-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:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
INF = 10**9

s, t = input().split()
n, m = map(int, input().split())
u = input().rstrip()

if u == s:
    n -= 1
else:
    m -= 1
print(n, m)

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 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()
print(*(A-1,B) if U==S else (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
if u == t :
    b -= 1
print(a, b)

Submission status: Accepted

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

if s == u:
    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()
d = dict()
d[s] = a
d[t] = b
d[u] -= 1
print("{0} {1}".format(d[s], d[t]))

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
else:
    M-=1
print(N,M)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s, T = LS()
    A, B = LI()
    U = S()
    if U == s:
        print(A-1, B)
    else:
        print(A, B-1)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A,B)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S, T  = [x for x in input().strip().split()]
A, B  = [int(x) for x in input().strip().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()
print(a-1, b) if u==s 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 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 = [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:
def main():
    s, t = [x for x in input().split()]
    a, b = [int(x) for x in input().split()]
    u = input()
    print(a-(s==u), b-(t==u))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s,t = list(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,B)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S, T = input().split()
A, B = map(int, input().split())
U = input()[: -1]
print(A - (S == U), B - (T == U))

Submission status: Accepted

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

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

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

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

print A,B

Submission status: Accepted

Solution code:
a,b=input().split()
n,m=map(int,input().split())
s=input()

if a == s:
  print(n-1,m)
else:
  print(n,m-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 = 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:
    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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Accepted

Solution code:
Ss, Ts = input().split()
A, B = map(int, input().split())
Us = input()

if Us == Ss:
    A -= 1
if Us == Ts:
    B -= 1

print(A, B)

Submission status: Accepted

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

print(A,B)

Submission status: Accepted

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

    print(A, B)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ライブラリインポート
from collections import defaultdict

con = 10 ** 9 + 7
#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	S, T = list(input().split())
	A, B = getlist()
	U = input()
	if S == U:
		A -= 1
	else:
		B -= 1
	print(A, B)
	


if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)


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:
# -*- coding: utf-8 -*-
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:
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools

mod = int(1e9+7)

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

Submission status: Accepted

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

Submission status: Accepted

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


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()
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:
    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:
    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
if (t == u):
    b = b-1


print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

if U  == S:
  print(a-1,  b)
else:
  print(a,  b-1)

Submission status: Accepted

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

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

s,t = ns().split()
a,b = nm()
u = ns()
if u == s:
    a -= 1
else:
    b -= 1
print(a,b)

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s,t = input().split()
a,b = LI()
u = input()
if s == u:
    a -= 1
elif t == u:
    b -= 1
print(a,b)

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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

def main():
  s,t=LS()
  a,b=LI()

  u=S()

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

main()
# print(main())

Submission status: Accepted

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

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

print(A,B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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())
x = input()
if x == 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:
        print(a - 1, b)
    else:
        print(a, b - 1)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import calendar
import fractions
import itertools

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    s, t = rl()
    a, b = rli()
    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 = raw_input().split()
A, B = map(int, raw_input().split())
U = raw_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())
if input()==s: print(a-1, b)
else: print(a, b-1)

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

s,t = input().split()
a,b = get_nums_l()
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
if U == T :
  B -= 1
  
print(A, B)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S, T = input().split()
A, B = [int(_) for _ 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 S==U:
  print(A-1, B)
else:
  print(A, B-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    S,T=input().split()
    A,B=map(int,input().split())
    U=input()
    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)
else:
    print(a,b-1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


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


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

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


S, T = sys.stdin.buffer.readline().decode().rstrip().split()
A, B = list(map(int, sys.stdin.buffer.readline().split()))
U = sys.stdin.buffer.readline().decode().rstrip()

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

Submission status: Accepted

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