cws.py, 150 lines, haha