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: x = int(input())
  ans2 = 1
  ans3 = 1
  ans5 = 1
  for i in range(32):
      if x >= i**2:
          ans2 = i**2
  for i in range(10):
      if x >= i**3:
          ans3 = i**3
  for i in range(3):
      if x >= i**5:
          ans5 = i**5
  if max(ans2, ans3, ans5) < 128 < x:
      print(128)
  elif max(ans2, ans3, ans5) < 512 < x:
      print(512)
  else:
      print(max(ans2, ans3, ans5))
  
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"}]