Time limit too strict for Python