P10698 [HackerEarth] come to me
普及
题目描述

Some terrorist attacks on Indian border. Now Indian Army have to send his soldiers to fight against terrorist. There are total N soldiers in the camp. Every soldier has a skill denoted by a single character lies between A-Z (all skills are in CAPITAL LETTERS). Now commander gave order to stand all the soldiers in a row, so that he can select a segment of maximum number of soldiers from the row to sent them for fighting against the terrorist.

INPUT

First line contains number of test cases T, for each test case a single line represents soldiers standing in a row with their skill.

OUTPUT

A single line representing maximum number of soldiers that commander selects for each test case.

Constraints:

1 ≤ T ≤100

1 ≤ N ≤ 10000

SAMPLE INPUT
2
ABDEFGABEF
GHJKLMNOPQ

SAMPLE OUTPUT
6
10

Explanation

For first test case, the soldier skills are “ABDEFGABEF” maximum soldiers with different skills are “ABDEFG” and “BDEFGA”, "DEFGAB" with length 6.

输入格式

见题面

输出格式

见题面

样例输入
2 ABDEFGABEF GHJKLMNOPQ SAMPLE
样例输出
6 10