q4(halfwaey)

q2 can only run in python2