POJ 3061 Subsequence