Tinkered around with a brain teaser. Incomplete.