#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}"


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}')


if __name__ == '__main__':
    main() from typing import * import collections collections import functools functools import itertools itertools import math math import sys sys INF = float('inf') INF float('inf') float 'inf' def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}" solve return f"{A-(S==U)} {B-(T==U)}" f"{A-(S==U)} {B-(T==U)}" S: str S T: str T A: int A B: int B U: str U def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}') main sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens S = next(tokens) S next(tokens) next tokens T = next(tokens) T next(tokens) next tokens A = int(next(tokens)) A int(next(tokens)) int next(tokens) next tokens B = int(next(tokens)) B int(next(tokens)) int next(tokens) next tokens U = next(tokens) U next(tokens) next tokens print(f'{solve(S, T, A, B, U)}') print f'{solve(S, T, A, B, U)}' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}') def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}') main def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}" def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}" solve INF = float('inf') float('inf') INF
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(S: str, T: str, A: int, B: int, U: str):
    return f"{A-(S==U)} {B-(T==U)}"


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    U = next(tokens)  # type: str
    print(f'{solve(S, T, A, B, U)}')


if __name__ == '__main__':
    main()
