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-----
red blue
3 4
red

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

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

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

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)

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

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

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

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

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)

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)

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

s,t=input().split();a,b=map(int,input().split())
n=[(a,b-1),(a-1,b)][s==input()];print(*n,sep=' ')

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

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

s,t = input().split()
a,b = map(int,input().split())
u = input()
print(a if u == t else a-1, end = " ")
print(b-1 if u == t else b)

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

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

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)

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

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

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

print(a, b)

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

if U ==S:
  A-=1
elif U ==T:
  B-=1
print ('{} {}'.format(A,B))

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)

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

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


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

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

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

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

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


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)

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


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

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

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

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

D = {}
s, t = input().split()
a, b = map(int, input().split())
D[s] = a
D[t] = b
D[input()] -= 1
print(D[s], D[t]) 

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

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

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)

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)

keys = list(map(str, input().split()))
values = list(map(int, input().split()))
rm_str = input()

dicts = {key: value for key, value in zip(keys, values)}
dicts[rm_str] = dicts[rm_str] - 1

print((' '.join([str(n) for n in list(dicts.values())])))


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

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

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

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)

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

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

print(A,B)

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

import sys
s,t =input().split()
a,b = map(int, input().split())
u=input()
if u==s:
    print(a-1,b)
if u==t:
    print(a,b-1)

# coding: utf-8
# Your code here!

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

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


def main():
    s,t = input().split(" ")
    a, b = map(int, input().split(" "))
    u = input()
    if u == s :
        a-= 1
    else:
        b -= 1
    print(f"{a} {b}")

def __starting_point():
    main()
__starting_point()

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

S,T=input().split()
A,B=map(int,input().split())
ans={S:A,T:B}
ans[input()]-=1
print(*ans.values())

a,b = input().split()
n,m = map(int, input().split())
s = input()
if a == s:
  print(n-1,m)
else:
  print(n,m-1)

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

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

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

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)

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

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

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

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)

s,t = input().split()
a,b = [int(x) for x in input().split()]
u = input()
if s == u:
  print(str(a-1) + " " + str(b))
else:
  print(str(a) + " " + str(b-1))

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

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)

S, T = input().split()
A, B = [int(n) for n in input().split()]
if input() == S:
    A -= 1
else:
    B -= 1

print(A, B)

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

x,y =input().split()
z,w =map(int,input().split())
u = input()
if x==u:
  print(z-1,w)
else:
  print(z,w-1)

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)

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

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

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

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

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

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

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

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

a,b = input().split()
a_num,b_num = map(int, input().split())
c=input()
if(c==a):
  a_num -= 1
else:
  b_num -= 1
print(a_num,b_num)

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

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

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)

s, t = input().split()
a, b = [int(i) for i in input().split()]
u = input()
if s == u:
  a -= 1
elif t == u:
  b -= 1
print(a, b)

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)

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

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)

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)

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

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

print(a, b)

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

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)

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

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

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)

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)

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

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

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

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

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

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

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

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)

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)

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

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