memoized digit-to-lines