#!/usr/bin/perl -w

while ($l=<STDIN>) {
	$Ri = $1 if($l =~ /Ri\=(\d+)\s/) ;
	$hi = $1 if($l =~ /heater\_integral\=(\d+)\s/) ;
	if($l =~ /heatercommand\=(\d+)\s/) {
		print $Ri . "\t".signednum($hi)."\t".$1."\n";
	}
} 
sub signednum
{
	my $u = shift;
	return $u if $u < 32768;
	return $u - 65535;
}
