100 atcoder#ABC154A. [ABC154A] Remaining Balls

[ABC154A] Remaining Balls

Score : 100100 points

Problem Statement

We have AA balls with the string SS written on each of them and BB balls with the string TT written on each of them. From these balls, Takahashi chooses one with the string UU written on it and throws it away. Find the number of balls with the string SS and balls with the string TT that we have now.

Constraints

  • SS, TT, and UU are strings consisting of lowercase English letters.
  • The lengths of SS and TT are each between 11 and 1010 (inclusive).
  • STS \not= T
  • S=US=U or T=UT=U.
  • 1A,B101 \leq A,B \leq 10
  • AA and BB are integers.

Input

Input is given from Standard Input in the following format:

SS TT

AA BB

UU

Output

Print the answer, with space in between.

red blue
3 4
red
2 4

Takahashi chose a ball with red written on it and threw it away. Now we have two balls with the string SS and four balls with the string TT.

red blue
5 5
blue
5 4

Takahashi chose a ball with blue written on it and threw it away. Now we have five balls with the string SS and four balls with the string TT.