#P7106. Complementary Hex Color
Complementary Hex Color
Complementary Hex Color
In this problem, an RGB color is represented by a triple \( (r,g,b) \) where each of \( r, g, b \) is an integer satisfying \( 0 \le r,g,b \le 255 \). The complementary color (or negative) of \( (r,g,b) \) is defined as \( (255-r,\,255-g,\,255-b) \).
In modern applications, colors are also represented by hexadecimal color codes. A hexadecimal color code is a string of length 7 that begins with a '#' character, followed by two hexadecimal digits for the R value, two for the G value, and two for the B value. The hexadecimal digits are chosen from 0-9 and A-F (in uppercase), and when converted to decimal form, they equal the corresponding color channel value. For example, the hexadecimal code #EBA932
corresponds to R = 235, G = 169, B = 50.
Your task is: Given a set of hexadecimal color codes, output the hexadecimal color code of its complementary color. Note that when converting numbers to hexadecimal string, you must produce exactly two digits (adding a leading zero if necessary), and the letters must be uppercase.
inputFormat
The first line of input contains an integer \(T\) (\(1 \le T \le 1000\)), representing the number of test cases. Each of the following \(T\) lines contains a valid hexadecimal color code string of length 7.
outputFormat
For each test case, output the complementary hexadecimal color code on a separate line.
sample
1
#000000
#FFFFFF