a.next() doesn't work in python3.4