#C6886. DNA Complement
DNA Complement
DNA Complement
Given a DNA sequence consisting solely of the characters A
, T
, C
, and G
, your task is to compute its complementary sequence using the base pairing rules. According to the rules, the complementary bases are given by the following relations: $$A \to T, \quad T \to A, \quad C \to G, \quad G \to C.$$
The program must read a single DNA string from the standard input and output its complementary sequence to the standard output.
inputFormat
The input consists of a single line containing a non-empty DNA string. The string will only include the uppercase letters A
, T
, C
, and G
.
outputFormat
Output a single line which is the complementary DNA sequence corresponding to the input based on the following base pairing rules: $$A \to T, \quad T \to A, \quad C \to G, \quad G \to C.$$
## sampleATCG
TAGC