import time from math import sqrt int raw_input time time def sq if if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import time
from math import sqrt
i = int(raw_input())
t = time.time()
def sq(i, m):
if m == 1:
if int(sqrt(i)) - sqrt(i) == 0: return [int(sqrt(i))]
return False
n = int(sqrt(i/float(m)))
while n > 0:
res = sq(i-n**2, m-1)
if res: return [n] + res
n -= 1
return False
#def result(i, m=1):
# res = sq(i, m)
# if res: return res
# return result(i, m+1)
def result(i, m=4):
res = sq(i, m)
if res: return res
return result(i, m-1)
print result(i), time.time()-t