Option Explicit On

Module Module1

    Sub Main()

        Dim X As Integer = Console.ReadLine()

        Dim a As Integer = 0
        Dim b As Integer = 0

        Do
            Dim ga As Long = gojo(a)
            Dim gb As Long = gojo(b)

            If ga - gb = X Then
                Console.WriteLine(a & " " & b)
                Exit Do
            Else
                If ga - X < gb Then
                    b -= 1
                Else
                    a += 1
                    If ga - X > gb Then
                        b += 1
                    Else
                        b -= 1
                    End If
                End If
            End If
        Loop

    End Sub

    Private Function gojo(a As Integer) As Long

        Dim ret As Long

        ret = a * a * a * a * a

        Return ret

    End Function

End Module
