In a double-stranded DNA molecule, the two antiparallel strands are complementary.
Left: the nucleotide base pairs that can form in double-stranded DNA. Between A and T there are two hydrogen bonds, while there are three between C and G. Right: two complementary strands of DNA.
By convention, we write a DNA sequence from 5’ end to the 3’ end. Therefore, the sequences of the two strands in double-stranded DNA are each others reverse complement. The reverse complement of a DNA sequence is obtained by first replacing every occurrence of the base A with the complementary base T (and vice versa), and replacing every occurrence of the base G with the complementary base C (and vice versa), and finally reversing the sequence of characters.
Write a program to determine the reverse complement of a DNA sequence.
A single line with a DNA sequence as a string.
A single line with the reverse complement of the sequence.
Input:
TACCCACGAGGCCAACAGCTGGGAGAGGATCAGCTTCAGGACCTACACCTAGAAGGATTA
Output:
TAATCCTTCTAGGTGTAGGTCCTGAAGCTGATCCTCTCCCAGCTGTTGGCCTCGTGGGTA