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 Java8 (OpenJDK 1.8.0) (judge verdict: Runtime Error)

import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
	   PrintWriter pw=new PrintWriter(System.out);
		int n=sc.nextInt();
		int k=sc.nextInt();
		double[] arr=new double[n];
		for(int i=0;i<n;i++) {
			arr[i]= (sc.nextDouble()+1)/2;
		}
		double max=0;
		double sum=0;
		for(int i=0;i<n-k+1;i++) {
			for(int j=i;j<k+i;j++) {
				sum=sum+arr[j];
			}
			if(sum>max) {
				max=sum;}
			sum=0;
		}
		pw.println(max);
		pw.flush();
		pw.close();
	}
	static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;
 
        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
 
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
 
        public int nextInt() throws IOException {return Integer.parseInt(next());}
 
        public long nextLong() throws IOException {return Long.parseLong(next());}
 
        public String nextLine() throws IOException {return br.readLine();}
 
        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }
 
        public boolean ready() throws IOException {return br.ready();}
 
 
    }

}