And Or

Given A and B, 1 ≤ A ≤ B ≤ 1018, find the result of A|(A+1)|(A+2)|...|B and A&(A+1)&(A+ 2)&...&B. | operator represents bitwise OR (inclusive) & operator represents bitwise AND Input The first line of the input contains an integer T (T ≤ 100000) denoting the number of test cases. Each of the following T lines has two space separated integers A and B, 1 ≤ A ≤ B ≤ 1018. Output For each input, print the output in the format, ‘Case C: X Y ’ (quote for clarity). here C is the case number starting from 1, X is the result of bitwise (inclusive) OR of numbers from A to B inclusive and Y is the result of bitwise AND of numbers from A to B, inclusive. For the exact input/output format please check the sample input/output section. Note: | operator represents bitwise OR. A bitwise OR takes two bit patterns of equal length and performs the logical inclusive OR operation on each pair of corresponding bits. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1; otherwise, the result is 0. [Source: Wikipedia] & operator represents bitwise AND. A bitwise AND takes two equal-length binary representations and performs the logical AND operation on each pair of the corresponding bits, by multiplying them. Thus, if both bits in the compared position are 1, the bit in the resulting binary representation is 1 (1 × 1 = 1); otherwise, the result is 0 (1 × 0 = 0). [Source: Wikipedia] Sample Input 2 11 12 Sample Output Case 1: 1 1 Case 2: 3 0