#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* input example

123+4X6=X79
12X+4X6=X79
XX22+89=X2XX

*/

const char NUM_CHARS[] = "0123456789";
char str[126] = {0}, value;
int flag;

void make(int L, int digit, char *exp) {
  int i, j, k;
  char p[256], buf[126];
  int a, b, ans;
  strcpy(p, exp);
  if (digit == 0) {
    for (i = 0, j = 0; i < 126; i++)
      if (exp[i] == 'X')
        p[i] = str[j++];
    for (i = 0; i < 100; i++)
      if (p[i] == '=') {
        for (j = i + 1, k = 0; j < 100; j++)
          buf[k++] = p[j];

        for (j = i; j < 100; j++)
          p[j] = '\0';
      }
    ans = atoi(buf);
    sscanf(p, "%d+%d", &a, &b);

    if (ans == (a + b)) {
      printf("%d+%d=%d (%d)\n", a, b, (a + b), ans);
      value = str[0];
      flag = 1;
    }
    return;
  }
  for (int i = 0; i < 10; i++) {
    str[L - digit] = NUM_CHARS[i];
    make(L, digit - 1, exp);
  }
}

int main(void) {
  int i, j, k, n;
  char exp[150][126];
  for (i = 0; scanf("%s", exp[i]) != EOF; i++)
    ;
  n = i;

  for (i = 0; i < n; i++) {
    flag = 0;
    for (j = 0, k = 0; j < 126; j++)
      if (exp[i][j] == 'X')
        k++;

    make(k, k, exp[i]);    
  }
  return 0;
}