You are given two integers
and . You need to construct two different strings and consisting of only the characters and , such that the following conditions are satisfied:
- Both and are palindromes.
- Both and should contain exactly occurrences of and occurrences of .
If there are multiple possible answers, you may print any of them. If it is not possible to construct two distinct strings satisfying the conditions, print instead.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases. Then the test cases follow.
- Each test case consists of a single line of input containing two space-separated integers .
Output Format
For each test case:
- If it is not possible to construct two distinct strings satisfying the conditions, print
- Otherwise, print two lines — the first should contain the string and the second should contain
- If there are multiple possible answers, you may print any of them.
Constraints
Sample Input 1
2
2 4
3 3
Sample Output 1
abbbba
babbab
-1
Explanation
Test case : The three palindromes containing -s and -s are and . Printing any two of these is a valid answer.
Test case : There are no palindromes containing each of and .
No comments:
Post a Comment