

N=int(eval(input()))



Flag=0

while Flag==0:

  Tmp=N**0.5



  Tmp2 = round(Tmp)



  if Tmp2 == Tmp:

    Flag=1

  else:

    N -= 1



print(N)



N=int(eval(input()))



Tmp=int(N**0.5)

N = Tmp**2

print(N)

 
N = int(eval(input()))
Flag = 0
while Flag == 0:
    Tmp = N**0.5
    Tmp2 = round(Tmp)
    if Tmp2 == Tmp:
        Flag = 1
    else:
        N -= 1
print(N)

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

-Flag = 0 -while Flag == 0: -    Tmp = N**0.5 -    Tmp2 = round(Tmp) -    if Tmp2 == Tmp: -        Flag = 1 -    else: -        N -= 1 +Tmp = int(N**0.5) +N = Tmp**2