#!perl

$max_word_size=4;

while(<STDIN>){
	$text.=$_;
}

$len=length($text);

for($s=1;$s<=$max_word_size;++$s){
	for($i=0;$i<=($len-$s);++$i){
		$subs=substr($text,$i,$s);
#		$parent_subs=substr($subs,0,$s-1);
#		if($parent_subs eq ''){
#			$parent_subs="\'";	
#		}
#		$wl{$parent_subs}.="\t$subs";
		++$wc{$subs};
	}
}

@hkeys=keys %wc;
@standart_sorted_keys= sort @hkeys;

foreach $k (@standart_sorted_keys){
	(length($k)==$max_word_size) && (print $k."\t".$wc{$k}."\n");
}
