XYZ Matches


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Problem types

Nour and Manal brought you another nice challenge. You are given a string \(s\). You move it to the right by one position at a time. In addition, you remove the last character at each move. Then, you compare it with the unmoved version to get the number of matches the moving string gives.

Your task is to find the move that gives the maximum character matches between \(s\) and its moved versions.

Input Specification

The first line contains a string \(s\) composed only of characters x, y, and z where \(1 \leq |s| \leq 10^{5}\).

Output Specification

The output contains two integers \(c\) and \(m\) denoting the maximum character matches and the move where they have been gotten. Print the lowest move if multiple moves give the maximum character matches.

Sample Input

xxxyz

Sample Output

2 1

Sample Input

zxzzxzxxx

Sample Output

4 2

Sample Input

xyz

Sample Output

0 0

Notes

Refer to the explanation of testcases in Problem C - MH Matches.


Comments

There are no comments at the moment.