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:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy

# 最大公約数
def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" #探索した場所は探索できないようにする
    for i in range(4): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" #探索した場所は探索できないようにする
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      #print(q)
  return mlength

#素因数分解
def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a



#X = str(input()).split()
#a = [int(x) for x in input().split()]


ST = str(input()).split()
AB = str(input()).split()
A = int(AB[0])
B = int(AB[1])
U = str(input())

if(ST[0] == U):
  print(str(A-1)+ " " + str(B))
else:
  print(str(A) + " " + str(B-1))

Submission status: Accepted

Solution code:
''' Hey stalker :) '''
INF = 10**10
def main():
    #print = out.append
    ''' Cook your dish here! '''

    s, t = input().split()
    a, b = get_list()
    dic = {}
    dic[s] = a
    dic[t] = b
    dic[input()] -= 1
    print(dic[s], dic[t])



''' Pythonista fLite 1.1 '''
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
#from functools import reduce
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')

Submission status: Accepted

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

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

print(s,t)

Submission status: Accepted

Solution code:
Input = list(map(str,input().split()))
S = Input[0]
T = Input[1]

Input = list(map(int,input().split()))
A = Input[0]
B = Input[1]

U = str(input())

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

print(A,B)

Submission status: Accepted

Solution code:
x,y=input().split()
a,b=map(int,input().split())
z=input()
a=a-(x==z)
b=b-(y==z)
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(A,B)
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:
    A-=1
else:
    B-=1
print(str(A)+" "+str(B))

Submission status: Accepted

Solution code:
name = input().split()
num = list(map(int,input().split()))
choice = input()

if choice == name[0]:
    print(num[0]-1, num[1])
else:
    print(num[0], num[1]-1)

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

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


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:
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:
one, two = input().split()
a, b = map(int, input().split())
third = input()

if(one == third):
  print(a-1, b)
  
else:
  print(a, b-1)

Submission status: Accepted

Solution code:
def resolve():
    st= input().split()
    ab= list(map(int, input().split()))
    u=input()
    ab[st.index(u)] -=1
    print(*ab)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strings = input().split(' ')
remains = input().split(' ')
dec = input()

sRem = int(remains[0])
tRem = int(remains[1])

if dec == strings[0]:
  sRem -= 1
else :
  tRem -= 1

print("{} {}".format(sRem, tRem))

Submission status: Accepted

Solution code:
#A - Remaining Balls
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:
    A-=1
else:
    B-=1
ans=[A,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:
  a -= 1
elif t == u:
  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=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:
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:
    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 s==u:
    print(a-1,b)
else:
    print(a,b-1)

Submission status: Accepted

Solution code:
# 2020/02/09
# AtCoder Beginner Contest 154 - A

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

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

# Output
print(a, b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = input().split()
an, bn = map(int, input().split())
c = input()
if a == c:
  print(an - 1, bn)
else:
  print(an, bn - 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 = map(str, input().split())
a,b = map(int, input().split())
c = str(input())

if c == s:
  print("%d %d" %(a-1, b))
elif c == t:
  print("%d %d" %(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=input().split()
li = list(map(int,input().split()))
s1=input()
if s1 == s[0]:
    print(str(li[0]-1) + " "+str(li[1]))
else:
    print(str(li[0])+" "+str(li[1]-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:
S, T = input().split()
A, B = map(int, input().split())
U = input()

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

print("%d %d"%(balls[S], balls[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:
s, t = input().split()
a, b = map(int, input().split())
u = input()

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

Submission status: Accepted

Solution code:

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

if c == s[0]:
  print(a[0]-1, a[1])
else:
  print(a[0], a[1]-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:
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:
color = input().split(" ")
nums = list(map(lambda x: int(x), input().split(" ")))
U =input()
index = color.index(U)
nums[index] -= 1

print(nums[0], nums[1])

Submission status: Accepted

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

print(A, B)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Feb  9 20:50:13 2020

@author: H_Hoshigi
"""

S, T = input().split()
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:
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 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(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:
  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 (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(str(a-1)+' '+str(b))
else:
    print(str(a)+' '+str(b-1))

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S, T = sr().split()
A, B = lr()
U = sr()
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):
  A-=1
if(U==T):
  B-=1
print(str(A)+" "+str(B))

Submission status: Accepted

Solution code:
A, B = input().split()
a, b = map(int, input().split())
C = input()

if C == A:
    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:
s, t = input().split(" ")

d = {}
a, b = map(int, input().split(" "))
d[s] = a
d[t] = b

u = input()
d[u] -= 1
out = "%d %d" % (d[s], d[t])
print(out)

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()
color={}
color[s],color[t]=map(int,input().split())

r=input()

color[r]=color[r]-1

print(color[s],color[t])

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:
  print(A-1, B)
else:
  print(A, B -1)

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    s, t = args[0].split()
    a, b = map(int, args[1].split())
    u = args[2]

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

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


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
s,t = input().split()
a,b= list(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:
    A -= 1
else:
    B -= 1
    
print(str(A) + " " + str(B))

Submission status: Accepted

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

Submission status: Accepted

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

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

if U == S:
    print(str(A - 1) + " " + str(B))
elif U == T:
    print(str(A) + " " + str(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 = 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=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=[int(x) for x in 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
elif u == t:
    b -= 1
lst = [str(a),str(b)]
print(" ".join(lst))

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:
import math
import itertools
n, d = list(input().split())
A, B = list(map(int, input().split()))
u = input()

if n==u:
    print(A-1, B)
elif d==u:
    print(A, B-1)

Submission status: Accepted

Solution code:
from bisect import *
from collections import *
from fractions import gcd


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 sys
import 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(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S, T = LIST()
A, B = MAP()
U = input()

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

Submission status: Accepted

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

A()

Submission status: Accepted

Solution code:
A, B = map(str, input().split())
a, b = map(int, input().split())
x=input()

if x==A:
    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:
    A -= 1
if T==U:
    B -=1
print("{} {}".format(A, B))

Submission status: Accepted

Solution code:
#
import sys
import math
import numpy as np
import itertools



# いくつか入力
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 = [item for item in input().split()]
A, B = [int(item) for item in 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
S, T = input().strip().split()
A, B = [int(str) for str in 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 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 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)
elif t == u:
    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 = str(input())
if(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 st[0] == u:
    print(a-1, b)
elif st[1] == u:
    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(str(A)+" "+str(B))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from bisect import bisect_right, bisect_left
from collections import Counter, deque
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import groupby, permutations, combinations, product
from sys import stdin, stderr


# 最大公約数（ユークリッドの互除法）
# Python3.5 で math.gcd()が追加され、
# AtCoder環境と最新環境でパッケージが分かれてしまったので、自分で書いておく
def gcd(x, y):
    return x if y == 0 else gcd(y, x % y)


# 拡張ユークリッド互除法
# 正整数x, y について、a*x + b*y == gcd(x,y)なるa,bを返す。
# 特に、互いに素なるx, yについては a*x + b*y == 1 となる a, b。
def exgcd(x, y):
    if y == 0:
        return 1, 0
    a, b = exgcd(y, x % y)
    return b, a - (x // y) * b


# 最小公倍数
def lcm(x, y):
    m = gcd(x, y)
    return (x // m) * (y // m)


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


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

Submission status: Accepted

Solution code:
S, T = input().split()
s, t = [int(x) for x in input().split()]
U = input()
print(s-(U==S), t-(U==T))

Submission status: Accepted

Solution code:
S,T = map(str, input().split())
A,B= map(int, input().split())
U = str(input())
# H= list(map(int, input().split()))
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=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,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""




s,t = input().split()

a,b = m()

p = input()[:-1]

if p == s:
    a -= 1
    print("{0} {1}".format(a,b))
else:
    b -= 1
    print("{0} {1}".format(a,b))

Submission status: Accepted

Solution code:
a, b = map(str, input().split())
a_num, b_num = map(int, input().split())
strings = input()

if strings == a:
    print(a_num -1, b_num)
elif strings == b:
    print(a_num, b_num -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(str(a-1) + ' ' + str(b))
elif u == t:
    print(str(a) + ' ' + str(b-1))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    s, t = LS()
    a, b = LI()
    u = S()
    if u == t:
        print(" ".join([str(a), str(b-1)]))
    else:
        print(" ".join([str(a-1), str(b)]))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

    if U == S:
        A -= 1
    elif U == T:
        B -= 1
    
    ans = str(A) + " " + str(B)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = a-(s == u)

print("{} {}\n".format(a-(s == u), b-(t == u)))

Submission status: Accepted

Solution code:
#import re
import sys
#input = sys.stdin.readline
#import heapq
#import bisect
#from collections import deque
#import math

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

    ball = {}
    ball[S] = A
    ball[T] = B
    ball[U] -= 1

    print("{} {}".format(ball[S], ball[T]))


main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
Scolor, Tcolor = input().split()
S, T = map(int, input().split())
U = input()

if U == Scolor:
  print(S-1, T)
else:
  print(S, T-1)

Submission status: Accepted

Solution code:
a,b = map(str, 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:
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)

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
a,b = input().split()
A,B = map(int, input().split())
U = input()

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

Submission status: Accepted

Solution code:
import sys


# N, M = map(int, input().split())
# nums = list(map(int, input().split()))
# nums_2d = [list(map(int, input().split())) for _ in range(N)]


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

if S[0] == U:
    A -= 1
else:
    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 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("{} {}".format((a-1),b))
elif u==t:
    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:
import queue
import copy
import math
from collections import deque
import bisect

# 2つの入力を空白で分割し、数値化
s, t = map(str, input().split())

n1, n2 = map(int, input().split())

color = input()

dict = {}
dict[s] = int(n1)
dict[t] = int(n2)

dict[color] = dict[color] - 1

print(str(dict[s]) + " " + str(dict[t]))

Submission status: Accepted

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

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

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 = list(map(str, input().split()))
a,b = list(map(int, input().split()))
u = str(input())

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

print(" ".join(list(map(str, [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 s==u:print(a-1,b)
else:print(a,b-1)