some python for longest increasing subsequence