Competitive Grammar Writing in Python