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 .

Solution (Python):
s,t = input().split()
A,B = map(int,input().split())
x = input()
if x == s:
  print(A-1, B)
else:
  print(A, B-1)

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

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

print(a, b)

Solution (Python):
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()

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

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

Solution (Python):
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)

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

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

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

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

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

Solution (Python):



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

Solution (Python):
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

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

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

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

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

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

Solution (Python):
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(" ")]


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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
S, T = input().split()
A, B = [int(_) for _ in input().split()]
U = input()
if S == U:
    A -= 1
else:
    B -= 1
print(A, B)

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

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

Solution (Python):
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()

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

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

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

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

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

Solution (Python):

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)  
    T = next(tokens)  
    A = int(next(tokens))  
    B = int(next(tokens))  
    U = next(tokens)  
    solve(S, T, A, B, U)


if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):
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



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])

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

Solution (Python):

S,T = input().split()

A,B = map(int,input().split())

U = input()

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

print (A,B)

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

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

Solution (Python):



def main():
    import sys
    sys.setrecursionlimit(10**6)
    

    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)


if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):


import sys
sys.setrecursionlimit(300000)


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

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

if __name__ == '__main__':
    main()

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

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

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

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