unittest
{
	assert( [ "33" ].parse.expand.solve == "2 -1" );
//	assert( [ "1" ].parse.expand.solve == "0 -1" );
	assert( [ "1" ].parse.expand.solve == "1 0" );
}



import std.bigint;
import std.conv;
import std.format;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto x = input.front.to!( long );
	return tuple( x );
}

auto solve( long x )
{
	auto xx = BigInt( x );
	
	BigInt[] fs;
	for( auto a = 0L;; a++ )
	{
		auto a5 = BigInt( a ) ^^ 5;
		fs ~= a5;
		foreach( long b; 0L .. a + 1 )
		{
			auto b5 = BigInt( b ) ^^ 5;
			if(  a5 -  b5 == xx ) return format( "%s %s",  a,  b );
			if(  a5 - -b5 == xx ) return format( "%s %s",  a, -b );
			if( -a5 -  b5 == xx ) return format( "%s %s", -a,  b );
			if( -a5 - -b5 == xx ) return format( "%s %s", -a, -b );
		}
	}
}
