#!usr/bin/perl

open (TABLE, $ARGV[0]);

	while ($line = <TABLE>){
		$line =~ s/\s+$//;
	
		@split = split "\t", $line;

		if ($split[0] =~ /./){

			@split_ = split "_", $split[0];

			$split_scaff_pos = $split_[0] . "_" . $split_[1];
	
			$scaff_pos_to_count{$split_scaff_pos} =  $scaff_pos_to_count{$split_scaff_pos} + $split[1];
			

			print $split[1], "\t", $split[0], "\n";
		}
	}

close TABLE;


#foreach $scaffpos (keys %scaff_pos_to_count){
#	print $scaffpos, "\t", $scaff_pos_to_count{$scaffpos}, "\n";
#}
