I\'ve spent like 20 hours on this so far and I can\'t come up with anything good. I want a generalization that applies to