convert lga16.py to Python3, confirmed identical output