#!/usr/bin/perl -w
$p = $ARGV[0];

$c = int(sqrt(2*$p)-.5);

$xi = $p -.5*$c*($c+1);
$yi = negpos($c -$xi+2);
$xi = negpos($xi);
print "$xi $yi\n";

sub negpos {
my($R) = $_[0];
return (int($R/2)) if (int($R/2)*2 == $R);
return (-int($R/2));
}
