#!/usr/bin/perl
use warnings;
use strict;

while(<>) {
	chomp;
	if ( m/^([0-9\.]+) .+aa fc 39 aa (.+) \|\s+(\d+\.\d+)/ ) {
		#warn "# $1 $2\n";
		my $temp = $3;
		my @l = split(/\s+/,$2);
		my @d = (
			$1,
			hex( $l[0] . $l[1] ),
			hex( $l[3] . $l[4] ),
			hex( $l[6] ),
			hex( $l[12] ),
			hex( $l[14] ) * 300,
			hex( $l[15] ) * 400,
			hex( $l[18] ),
			$temp
		);
		print join(',', @d),$/;
	} else {
		warn "# $_\n";
	}
}
