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.




with Ada.Text_IO; use Ada.Text_IO;
 
procedure Simple_FASTA is
 
   Current: Character;
 
begin 
   Get(Current); 
   if Current /= '>' then
      raise Constraint_Error with "'>' expected";
   end if;
   while not End_Of_File loop -- read name and string
      Put(Get_Line & ": "); -- read name and write directly to output
      Read_String:
      loop
	 exit Read_String when End_Of_File; -- end of input
	 Get(Current);
	 if Current = '>' then -- next name
	    New_Line; 
	    exit Read_String;
	 else
	    Put(Current & Get_Line); 
	    -- read part of string and write directly to output
	 end if;
      end loop Read_String;
   end loop;
 
end Simple_FASTA;