def f(x,h):
if h==4:
if (x>=20) and (x<=26):
return 1
elif h==4 and x<20:
return 0
elif h<4 and x>=20:
return 0
else:
if h%2!=0:
return f(x+4, h+1) or f(x*2, h+1)
else:
return f(x+4, h+1) and f(x*2, h+1)
for x in range(1, 20):
if f(x, 1)==1:
print(x)
def f(x, h):
if h == 4:
if 20 <= x <= 26:
return 1
else:
return 0
elif h < 4:
if 20 <= x <= 26:
return 0
else:
if h % 2 != 0:
return f(x + 4, h + 1) or f(x * 2, h + 1)
else:
return f(x + 4, h + 1) and f(x * 2, h + 1)
for x in range(1, 20):
if f(x, 1) == 1:
print(x)
def f(x, h):
if h == 3:
if 20 <= x <= 26:
return 1
else:
return 0
elif h < 3:
if 20 <= x <= 26:
return 0
else:
if h % 2 == 0:
return f(x + 4, h + 1) or f(x * 2, h + 1)
else:
return f(x + 4, h + 1) and f(x * 2, h + 1)
for x in range(1, 20):
if f(x, 1) == 1:
print(x)