#R1021. [KBC002E] Sequence 5
[KBC002E] Sequence 5
Problem Description
There is an operation defined as follows:
- For individual characters, .
- For a string and , we have , which means represents the string obtained by replacing the characters to in with .
Given a string , find the lexicographically smallest string obtained by applying the operation for all to .
Constraints
- consists of characters
A
,C
,G
,T
.
Input
The input is given in the following format from the standard input:
$\color{#cccccc}\boxed{\color{white}{\large{|}}\color{black}s\color{white}{\large{|}}}$
Output
Output the lexicographically smallest string obtained after applying the operations.
Sample Input
ACGTACGT
Sample Output
AACGACGT