Did you hear about alphametics? Task

The letters spell out actual words, but if you replace each letter with a digit from 0–9, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “word” can start with the digit 0.

Input

HAWAII + IDAHO + IOWA + OHIO = STATES


Output

510199 + 98153 + 9301 + 3593 = 621246


Input

I + LOVE + YOU = DORA


Output

1 + 2784 + 975 = 3760


    Input

SEND + MORE = MONEY


Output

9567 + 1085 = 10652


Rules


Standard loopholes apply.
shortest code wins.
addition only


Appendix

for other Inputs you gotta keep in mind you can only have 10 different characters(to assign values 0-9)
JavaScript (ES7), 104 bytes

f=(s,o,c=s.match(/[A-Z]/))=&gt;c?[...2**29+'4'].some(i=&gt;o&amp;1&lt;&lt;i?0:f(r=s.split(c).join(i),o|1&lt;&lt;i))&amp;&amp;r:eval(s)


Demo



f=(s,o,c=s.match(/[A-Z]/))=&gt;c?[...2**29+'4'].some(i=&gt;o&amp;1&lt;&lt;i?0:f(r=s.split(c).join(i),o|1&lt;&lt;i))&amp;&amp;r:eval(s)

console.log(f('I + LOVE + YOU == DORA'))




Formatted and commented

f = (                               // f = recursive function taking:
  s,                                //   s = input string
  o,                                //   o = bitmask of used digits
  c = s.match(/[A-Z]/)              //   c = next alphabetical character in s
) =&gt;                                //       (either null or a single-element array)
  c ?                               // if c is not null:
    [...2**29 + '4'].some(i =&gt;      //   for each character i of '5368709124'
      o &amp; 1 &lt;&lt; i ?                  //     if this digit was already used:
        0                           //       ignore this iteration
      :                             //     else:
        f(                          //       do a recursive call to f() with:
          r = s.split(c).join(i),   //         all characters c replaced with i
          o | 1 &lt;&lt; i                //         the updated bitmask
        )                           //       end of recursive call
    ) &amp;&amp; r                          //   end of some(): if successful, return r
  :                                 // else:
    eval(s)                         //   evaluate this fully numerical expression