User blog comment:Wythagoras/Extension to Friedmann's stuff/@comment-1605058-20130612190549/@comment-5150073-20130613093605

For example, given an expression:

222

2221

We can drop it on lines, and mark line 1 as 222 and line 2 as 2221. Lines are strings for now, and there must be no lines from line x to line 2x such that one is subsequence for another.