DNA

Write a backtracking program that prints all the combinations of length nn that can be made with the letters ‘A’, ‘C’, ‘G’, ‘T’ for a given nn.

Input

The input consists of a natural number n>0n > 0.

Output

Print all the combinations of nn letters ‘A’, ‘C’, ‘G’, ‘T’ in lexicographical order.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T11:31:41.773Z

© Jutge.org, 2006–2026.
https://jutge.org