public static void Main() {
for (int ef = 10; ef < 100; ef++) {
for (int cd = 10; cd < 100; cd++) {
if (new int[]{ef, gh, ab, cd}.SelectMany(o => new int[]{ o / 10, o % 10}).Distinct().Where(o => o != 1).Count() == 8 && ab > 9 && ab < 100) {
Console.WriteLine(string.Format("{0} - {1} = {2} + {3} = 111", ab, cd, ef, gh));