maximum length sequence python