Limits 5s, 512 MB

In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'.

The reverse complement of a DNA string S is the string Sc formed by reversing the symbols of S, then taking the complement of each symbol (e.g., the reverse complement of "GTCA" is "TGAC").
You will be given with a DNA string S of length at most 1000. You task is to write a program that will display the reverse complement Sc of S.

Input

First line contains the number of test cases T. The following T lines contain the DNA sequences S

Output

For each line of input produce one-line output, displaying reverse complement string Sc.

Sample

InputOutput
1
AAAACCCGGT
ACCGGGTTTT

Explanation of the sample case: For the given string GTCA, we take the reverse, that is ACTG. Then we replace each letter with its compliments and get TGAC.

Submit

Login to submit.

Statistics

98% Solution Ratio
touhidurrrEarliest, Oct '18
UB_MI6Fastest, 0.0s
junayed.mahmudLightest, 0 B
aNkanpy.pritomShortest, 139B
Toph uses cookies. By continuing you agree to our Cookie Policy.