import math

a = int(eval(input()))



for i in range(a):

  if a-i==math.floor(math.sqrt(a-i))**2:

    print((a-i))

    break
N = int(eval(input()))

print((int(N**.5)**2))

import math

a = int(eval(input()))
for i in range(a):
    if a - i == math.floor(math.sqrt(a - i)) ** 2:
        print((a - i))
        break

N = int(eval(input()))
print((int(N**0.5) ** 2))

-import math - -a = int(eval(input())) -for i in range(a): -    if a - i == math.floor(math.sqrt(a - i)) ** 2: -        print((a - i)) -        break +N = int(eval(input())) +print((int(N**0.5) ** 2))