output_description: Print the largest perfect power that is at most X.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X
attempt: import math
  def main():
    x = int(input())
    sum=0
    if x==0 or x==1:
      sum=x
    else:
      for i in range(2,int(math.sqrt(x))+1):
        j=2
        while True:
           if pow(i,j)<=x:
            if pow(i,j)>sum:
              sum=pow(i,j)
          else:
            break
          j+=1
    print(sum)
  main()
  
problem_description: Statement
  
  You are given a positive integer X. Find the largest _perfect power_ that is
  at most X. Here, a perfect power is an integer that can be represented as b^p,
  where b is an integer not less than 1 and p is an integer not less than 2.
samples: [{"input": "10", "output": "9\n    \n\nThere are four perfect powers that are at most 10: 1, 4, 8 and 9. We should\nprint the largest among them, 9.\n\n* * *"}, {"input": "1", "output": "1\n    \n\n* * *"}, {"input": "999", "output": "961"}]