Parentheses Problem In Python How To Sort