#include <stdio.h>
int main() {
int a,b,c,d,e;
for ( a=0; a<=9 ; a++ ) {
for ( b=0; b<=9 ; b++ )
for ( c=0; c<=9 ; c++ )
for ( d=0; d<=9 ; d++ )
if((a-b)*c+d==e)
printf("(%d-%d)*%d+%d\n",a
,b
,c
,d
); }
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+IAppbnQgbWFpbigpIHsgCglpbnQgYSxiLGMsZCxlOyAKCXNjYW5mKCIlZCIsJmUpOwoJZm9yICggYT0wOyBhPD05IDsgYSsrICkgewoJZm9yICggYj0wOyBiPD05IDsgYisrICkKCWZvciAoIGM9MDsgYzw9OSA7IGMrKyApCglmb3IgKCBkPTA7IGQ8PTkgOyBkKysgKQoJaWYoKGEtYikqYytkPT1lKQoJcHJpbnRmKCIoJWQtJWQpKiVkKyVkXG4iLGEsYixjLGQpOwl9CgkKCXJldHVybiAwOyAKCQp9IAo=