#!/usr/athena/bin/perl

$nth = shift;

while(<>){
    $ct++;
    @x = split;
    foreach $i (0..$#x){
	$tot[$i] += $x[$i];
    }
    if($ct == $nth){
	foreach $i (0..$#tot){
	    print $tot[$i]/$ct, " ";
	    $tot[$i] = 0;
	}
	$ct=0;
	print "\n";
    }
}
