#!/usr/bin/perl

use strict;
my $printing = 0;
my $minlength = 50;
my @hist;
my $n=0;

while(<STDIN>) {
  if ( /^>/ ) {
    my @a = split;
    $printing =  ( $a[2] >= $minlength );
    $hist[$a[2]]++;
    $n++;
  }
#  print if $printing;
}

my @freq;
my @cum;

for( my $k=1;$k<=$#hist;$k++) {
  $freq[$k] = $hist[$k]/$n;
  $cum[$k] = $cum[$k-1] + $hist[$k]*$k;

} 
my $m = $cum[$#cum];
for( my $k=1;$k<=5000;$k++) {
  
  print join( "\t", $k, $hist[$k]+0, $freq[$k], $cum[$k], $m-$cum[$k] ) . "\n";
}
