Arrows

We like to do ASCII art which involves creating various symbols or pictures using the ASCII characters. Today we are going to draw arrows! There are four types of arrows that can be drawn. Left single arrow, left double arrow, right single arrow and right double arrow. A left single arrow is defined by a left angle bracket character (‘<’) immediately followed by zero or more consecutive hyphen characters (‘-’). A left double arrow is a left angle bracket character (‘<’) immediately followed by zero or more consecutive equals characters (‘=’). A right single arrow is zero or more hyphen characters (‘-’) immediately followed by a right angle bracket character (‘>’). A right double arrow is zero or more equals characters (‘=’) immediately followed by a right angle bracket character (‘>’). For example, the following strings are arrows (quotes for clarity only): “==>”, “<-”, “<”, “<===”, “--->”, “>”. But “==----===” is not an arrow. The length of an arrow is measured by the number of characters it contains. You will be given a String s. Calculate the length of the longest arrow in s, or ‘-1’ if it does not contain any arrows at all. Input First line of the input is an integer T (1 ≤ T ≤ 150), the number of test cases. Each of the following T lines contain a string S, which is no longer than 50 characters and contains only the four different characters mentioned in the problem. Output For each test case, print a line in the following format: ‘Case X: Y ’ (without quotes), where X is the test case number starting from 1 and Y is the length of the longest arrow in the input string of corresponding test case. Check sample input and output for details. Sample Input 3 <<<<<<<<<< ----==- <----=====> Sample Output Case 1: 1 Case 2: -1 Case 3: 6