#include <stdio.h> int main() { int N, X, Y, Z; while (scanf("%d\n%d%d%d", &N, &X, &Y, &Z) != EOF) { int $_XYZ_ = 0; int wan, ge; int mid = X * 1000 + Y * 100 + Z * 10; int rewan, rege; for (wan = 1; wan < 10; wan++) { for (ge = 0;...