#!/usr/bin/perl -w

while (<>) {
	my @fields = split;
	$fields[0] -= $fields[1]/1000;
	print(map { "$_ " } @fields);
	print("\n");
}
