SP3109 STRLCP - Longest Common Prefix

Description

The LCP (Longest Common Prefix) of two strings A\[1..la\] and B\[1..lb\] is defined as follows: LCP(A\[1..la\],B\[1..lb\]) = max{L | L

Input Format

The first line will be number of test cases T. The first line of each test case is a string S with length L (1

Output Format

For each "Q i j" operation, print the answer.