In bioinformatics, long character strings are often encoded in a format called FASTA.

A FASTA file can contain several strings, each identified by a name marked by a > (greater than) character at the beginning of the line.



Task

Write a program that reads a FASTA file such as:

>Rosetta_Example_1
THERECANBENOSPACE
>Rosetta_Example_2
THERECANBESEVERAL
LINESBUTTHEYALLMUST
BECONCATENATED


Output:
Rosetta_Example_1: THERECANBENOSPACE
Rosetta_Example_2: THERECANBESEVERALLINESBUTTHEYALLMUSTBECONCATENATED

Note that a high-quality implementation will not hold the entire file in memory at once; real FASTA files can be multiple gigabytes in size.




bool first = true
integer fn = open("fasta.txt","r")
if fn=-1 then ?9/0 end if
while true do
    object line = trim(gets(fn))
    if atom(line) then puts(1,"\n") exit end if
    if length(line) then
        if line[1]=='>' then
            if not first then puts(1,"\n") end if
            printf(1,"%s: ",{line[2..$]})
            first = false
        elsif first then
            printf(1,"Error : File does not begin with '>'\n")
            exit
        elsif not find_any(" \t",line) then
            puts(1,line)
        else
            printf(1,"\nError : Sequence contains space(s)\n")
            exit
        end if
    end if
end while
close(fn)
