Big Integers
시간 제한2초메모리 제한2048 MB
서로 다른 두 개의 62진수 문자열이 주어질 때, 사전순으로 더 작은 문자열이 나타내는 정수가 실제로도 더 작은지 판정한다.
문제
Nick is preparing a problem for a programming contest about comparing big integers. He has decided on the input format for the integers: They will be expressed in base 62, with through representing digit values through , lowercase letters a through z representing digit values through , and uppercase letters A through Z representing digit values through . For example, the string Aa would represent .
The problem is to take two strings representing two distinct base 62 integers and determine which of the two is smaller. However, Nick wrote his judge solution incorrectly, assuming that the lexicographically smaller string is always the smaller integer.
Given some test cases, determine for each if Nick's solution would report the correct result.
입력
The first line of input contains a single integer (). This is the number of test cases.
Each test case consists of two lines.
The first line contains a single alphanumeric string of length at most .
The second line contains a single alphanumeric string of length at most .
Both strings are guaranteed to contain no unnecessary leading zeroes, and the two strings are guaranteed to be distinct.
The sum of the lengths of all input strings across all test cases is guaranteed to be at most .
출력
For each test case, output a single line with YES if the lexicographically smaller string represents the smaller integer in base 62, and output a single line with NO otherwise.