output_description: Print the answer, with space in between.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S T
      A B
      U
attempt: import sys
  
  
  TEST_INPUT = [
      """
      red blue
      3 4
      red
      """,
      """
      red blue
      5 5
      blue
      """,
  ]
  ANSWER = ["2 4", "5 4"]
  
  
  class InputHandler:
  
      def __init__(self, text_lines="", is_test=False):
          self.data = list(text_lines.split("\n"))
          self.index = 0
          self.is_test = is_test
  
      def input(self):
          if self.is_test:
              self.index += 1
              return self.data[self.index].strip()
          else:
              return sys.stdin.readline().rstrip()
  
  
  def solve(s, t, a, b, u):
      if s == u:
          return f"{a - 1} {b}"
      else:
          return f"{a} {b - 1}"
  
  
  def main():
      ih = InputHandler()
      s, t = ih.input().split()
      a, b = map(int, ih.input().split())
      u = ih.input()
      res = solve(s, t, a, b, u)
      print(res)
  
  
  def test():
      for test_input, ans in zip(TEST_INPUT, ANSWER):
          ih = InputHandler(test_input, True)
          s, t = ih.input().split()
          a, b = map(int, ih.input().split())
          u = ih.input()
          res = solve(s, t, a, b, u)
          assert str(res) == str(ans)
  
  
  if __name__ == "__main__":
      test()
      main()
  
problem_description: 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.
samples: [{"input": "red blue\n    3 4\n    red", "output": "2 4\n    \n\nTakahashi chose a ball with `red` written on it and threw it away. Now we have\ntwo balls with the string S and four balls with the string T.\n\n* * *"}, {"input": "red blue\n    5 5\n    blue", "output": "5 4\n    \n\nTakahashi chose a ball with `blue` written on it and threw it away. Now we\nhave five balls with the string S and four balls with the string T."}]