import threading
import time
def a():
th = threading.Thread(target=b)
th.start()
def b():
time.sleep(2)
print('end b')
a()
print('end a')
time.sleep(4)
print('end main')
aW1wb3J0IHRocmVhZGluZwppbXBvcnQgdGltZQogCmRlZiBhKCk6CiAgICB0aCA9IHRocmVhZGluZy5UaHJlYWQodGFyZ2V0PWIpCiAgICB0aC5zdGFydCgpCiAKZGVmIGIoKToKICAgIHRpbWUuc2xlZXAoMikKICAgIHByaW50KCdlbmQgYicpCiAKYSgpCnByaW50KCdlbmQgYScpCnRpbWUuc2xlZXAoNCkKcHJpbnQoJ2VuZCBtYWluJykK