public static void Main()
for (int first = 0; first < 10; first++)
for (int second = 0; second < 10; second++)
for (int third = 0; third <10; third++)
int fourth = (first + second) - third;
if ((fourth >= 0) && (fourth <=9))
Console.WriteLine ("" + first + second + third + fourth);