#genocon2021a. [genocon2021_a]Practice 1

[genocon2021_a]Practice 1

Score : 100100 points

Problem Statement

ss is a string consisting of characters A, C, G, T. The length of ss is NN.We denote ii-th character of ss as s\[i\] (1leqileqN1 \\leq i \\leq N). We define a complementary character for A, C, G, T, respectively, such that the complementary character of A is T, that of T is A, that of C is G, and that of G is C. A complementary character of any character aa is denoted by R(a)R(a). Under these definitions above, the reverse complement sequence of a string ss is defiend as: R(s\[N\]), R(s\[N-1\]),..., R(s\[2\]), R(s\[1\]). For example, the reverse complement sequence of AACGT is ACGTT.

Output all the reverse complement sequences of mm input sequences: s1s_1,...,sms_m.

Constraints

  • s1s_1,...,sms_m are strings consisting of A, C, G, T.
  • 1leqm<1001 \\leq m<100
  • 1leqs1,ldots,sm<10001 \\leq |s_1|, \\ldots, |s_m| <1000 (the length of xx is denoted by x|x|.)

Input

Input is given from Standard Input in the following format:

mm s1s1 s2s2 :: smsm

Output

Print reverse complement sequences of input sequences. Each sequence should be printed as a single line, and the order of the output sequences must be the same as the order of input sequences.


Sample Input 1

6
CATAGAACGACTATT
TA
GCGGCTTTTTGAAGCGT
TACCTTGATCA
GGCGTGCATAG
T

Sample Output 1

AATAGTCGTTCTATG
TA
ACGCTTCAAAAAGCCGC
TGATCAAGGTA
CTATGCACGCC
A