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.




$ include "seed7_05.s7i";
 
const proc: main is func
  local
    var file: fastaFile is STD_NULL;
    var string: line is "";
    var boolean: first is TRUE;
  begin
    fastaFile := open("fasta_format.in", "r");
    if fastaFile <> STD_NULL then
      while hasNext(fastaFile) do
        line := getln(fastaFile);
        if startsWith(line, ">") then
          if first then
            first := FALSE;
          else
            writeln;
          end if;
          write(line[2 ..] <& ": ");
        else
          write(line);
        end if;
      end while;
      close(fastaFile);
    end if;
    writeln;
  end func;