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