Solution to the longest increasing subsequence problem in page 397.