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.

Solution in Rust (1.15.1) (judge verdict: Runtime Error)

use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::Ordering;
use std::cmp::{max, min};

fn main() {
    let n: usize = read();
    let mut k: usize = read();
    let mut p: Vec<i64> = read_n(n);
    let mut ans: f64 = 0.0;
    let mut maxans: f64 = 0.0;

    let len = p.len();
    for i in 0..k {
        let pi = p[i];
        ans += (pi + 1) as f64 / 2.0;
    }

    for i in k..n {
        let a = p[i];
        let b = p[i - k];
        ans = ans - ((b + 1) as f64 / 2.0) + ((a + 1) as f64 / 2.0);
        match maxans.partial_cmp(&ans).unwrap() {
            Ordering::Less => maxans = ans,
            Ordering::Equal => (),
            Ordering::Greater => ()
        }
    }
    println!("{}", maxans);
}