imports System

Module Module1
  public Sub Main()

    Dim X as Double = Console.ReadLine()

	Dim A as Double
	Dim B as Double

	A = 0
    B = 0

		for A = 1 to X Step 1

			for B = 0 to -X Step 1

				if A^5 - B^5 = X then 

					exit for

				elseif A^5 - B^5 > X then
					
					exit for
					
				end if

			next 

			if A^5 - B^5 = X then 
				exit for
			end if

		next

		if A^5 - B^5 = X then 

			console.writeLine(A.tostring & " " & B.tostring)
			exit sub

		else

			for A = 0 to X Step 1

				for B = 0 to -X Step -1

					if A^5 - B^5 = X then 

						exit for

					elseif A^5 - B^5 > X then
						
						exit for
						
					end if

				next 

				if A^5 - B^5 = X then 
					exit for
				end if

			next

		end if

		if A^5 - B^5 = X then 

			console.writeLine(A.tostring & " " & B.tostring)
			exit sub

		else

			for A = 0 to X Step -1

				for B = 0 to -X Step 1

					if A^5 - B^5 = X then 

						exit for

					elseif A^5 - B^5 > X then
						
						exit for
						
					end if

				next 

				if A^5 - B^5 = X then 
					exit for
				end if

			next

		end if

		if A^5 - B^5 = X then 

			console.writeLine(A.tostring & " " & B.tostring)
			exit sub

		else

			for A = 0 to X Step -1

				for B = 0 to -X Step -1

					if A^5 - B^5 = X then 

						exit for

					elseif A^5 - B^5 > X then
						
						exit for
						
					end if

				next 

				if A^5 - B^5 = X then 
					exit for
				end if

			next

		end if

		console.writeLine(A.tostring & " " & B.tostring)


  End Sub
End Module









	elseif X > 0 then

		for A = 0 to X Step 1

			for B = 0 to -X Step -1

				if A^5 - B^5 = X then 

					exit for

				elseif A^5 - B^5 > X then
					
					exit for
					
				end if

			next 

			if A^5 - B^5 = X then 
				exit for
			end if

		next

		console.writeLine(A.tostring & " " & B.tostring)

	else 

		console.writeLine("1".tostring & " " & "1".tostring)

	end if
	

  End Sub
End Module

