#K81102. DNA Sequence Analysis

    ID: 35679 Type: Default 1000ms 256MiB

DNA Sequence Analysis

DNA Sequence Analysis

Given a DNA sequence composed solely of the characters \(A\), \(C\), \(G\), and \(T\), your task is to count the number of occurrences of each nucleotide and determine the most frequent nucleotide. In case of ties, choose the nucleotide with the smallest lexicographical order (i.e. \(A < C < G < T\)).

The result should output the four counts for \(A\), \(C\), \(G\), and \(T\) respectively, followed by the most frequent nucleotide.

inputFormat

The input consists of a single line read from standard input (stdin) containing a DNA sequence. The sequence will only contain the characters \(A\), \(C\), \(G\), and \(T\).

outputFormat

Print five values separated by a single space: the counts of \(A\), \(C\), \(G\), and \(T\) in the given sequence, followed by the most frequent nucleotide. For example, for the input "ACGTACGTAC", the expected output is "3 3 2 2 A".

## sample
ACGTACGTAC
3 3 2 2 A