def main_DNA(dna):
    """Counting the respective number of times that the symbols 'A', 'C', 'G', and 'T' occur in dna."""
    if len(dna) > 1000 or len(dna) <= 0:
        raise Exception('Input Error')
    dna_counts = map(dna.count, ['A', 'C', 'G', 'T'])
    return ' '.join(map(str, dna_counts))