# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Michael Scofield and Lincoln Burrows are working on a secret mission. Michael is needed to give a secret number to his brother Lincoln. Since the mission is secret and the secret number should not be known to others so Michael gave two strings to his brother instead of that number!

For finding the secret number, first, Lincoln will take the first string and add all the numeric digits from that string. By this, he will get a number `$x$`

. Lincoln will do the same process for the second string, and he will get another number `$y$`

. Then Lincoln will get three numbers `$a$`

, `$b$`

, `$c$`

by adding, multiplying and subtracting `$x$`

and `$y$`

respectfully. For Subtraction, he will take the absolute value. The secret number is the second smallest number in `$a$`

, `$b$`

, `$c$`

.

Since, Lincoln is weak at mathematics, he hired you for finding the secret number.

The first line of input contains a string `$s1 \hspace{.1cm} (1 \leq |s1| \leq 50)$`

.

The second line of input contains a string `$s2 \hspace{.1cm} (1 \leq |s2| \leq 50)$`

.

Both strings contain only one word.

Print the secret number inside a double quotation.

Input | Output |
---|---|

hfwi759kqk fowjedk411wiepf | "27" |

Input | Output |
---|---|

tpzKd24 fvd493dphq | "22" |

`$|s|$`

denotes the length of the string `$s$`

.

94% Solution Ratio

Fazlerabbi.Earliest,

Fazlerabbi.Fastest, 0.0s

Uosmoy383Lightest, 0 B

Farhan_NizamiShortest, 275B

Login to submit