def four(n):
if n - 4 != 0:
if n % 10 == 0:
four(n//10)
elif n % 10 == 4:
four(n//10)
else:
four(n * 2)
print(n, end=" ")
def main():
four(1234)
main()
ZGVmIGZvdXIobik6CglpZiBuIC0gNCAhPSAwOgoJICAgaWYgbiAlIDEwID09IDA6CgkgICAJICBmb3VyKG4vLzEwKQoJICAgZWxpZiBuICUgMTAgPT0gNDoKCSAgIAkgIGZvdXIobi8vMTApCgkgICBlbHNlOgoJICAgCSAgZm91cihuICogMikKCXByaW50KG4sIGVuZD0iICIpIAoKZGVmIG1haW4oKToKCWZvdXIoMTIzNCkKbWFpbigpCQ==