Given a string, find length of the longest substring with all distinct characters. For example, for input "abca", the output is 3 as "abc" is the longest substring with all distinct characters.

**Input:**

The first line of input contains an integer T denoting the number of test cases.

The first line of each test case is String str.

**Output:**

Print length of smallest substring with maximum number of distinct characters.

Note: The output substring should have all distinct characters.

**Constraints:**

1 ≤ T ≤ 100

1 ≤ size of str ≤ 10000

**Example:**

Input

2

abababcdefababcdab

geeksforgeeks

Output:

6

7

just_kiddin | 61 |

Devina Mohan | 59 |

BackSlashNull | 53 |

PALINDROME | 52 |

Sangeeta S | 52 |

gameghost07 | 488 |

xyz2017 | 486 |

N NAGA SAI KRISHNA | 445 |

Divyasri | 426 |

Anshu Ahirwar | 424 |

akhayrutdinov | 3391 |

sanjay05 | 3239 |

Jasleen Kaur 2 | 2012 |

Elite Coder | 1805 |

Michael Riegger | 1791 |