#!/usr/bin/perl
$,=" ";
foreach(<>){
	($str, $uzlu, $delka) = /^[0-9]: (\[[^\]]+\])\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s+([0-9]+)/;
	#print $str, $delka, "\n";
	$delky{$str} += $delka*10_000_000+$uzlu;
	$uzly{$str}  += $uzlu*10_000+$delka;
	$mix{$str}   += $delka*$delka*$delka*$uzlu;
}
$min = 99_999_999_999; $pamatuj = "";
map { if($min > $delky{$_}){ $min = $delky{$_}; $pamatuj = $_; } } keys %delky;
print "Min delka: $pamatuj", $delky{$pamatuj}/10_000_000, $uzly{$pamatuj}/10_000, "\n";

$min = 99999999999; $pamatuj = "";
map { if($min > $uzly{$_}){ $min = $uzly{$_}; $pamatuj = $_; } } keys %uzly;
print "Min uzlu: $pamatuj", $delky{$pamatuj}/10_000_000, $uzly{$pamatuj}/10_000, "\n";

$min = 99999999999; $pamatuj = "";
map { if($min > $mix{$_}){ $min = $mix{$_}; $pamatuj = $_; } } keys %mix;
print "Mix: $pamatuj", $delky{$pamatuj}/10_000_000, $uzly{$pamatuj}/10_000, "\n";
