Is it the hardest programming puzzle I've ever seen? No. Would it be a fun diversion on a subway ride? Yes (the first time at least). It's one of the trickier subway ads I've ever seen - not the hardest mind you - that was on the Paris Metro; I'm still not sure if it was an ad for beard combs or funerals.
Anyway, I was hoping you'd have re-written it by now in a purely functional way.