darn interwebs are down - can't submit it till later.
Removed debug step and fixed string formatting.
Relatively straightforward brute force solution.
Click bottom right to win.
Quick right up - double check correct method used on deceitful_war
Modified algorithm - slower, but correct!
Totally misunderstood this question... and still did it wrong!