Digit-wise modulo 3#3651

Digit-wise modulo 3

1 segundo
64 megabytes
Muy fácil

Given two non-negative ternary numbers, your task is to compute a new ternary number by performing digit-wise addition modulo on all ternary numbers that lie between the two given numbers, inclusive.

Each of the provided numbers can have up to digits.

Entrada

The input consists of two lines. The first line contains the first ternary number, and the second line contains the second ternary number.

Salida

Output a single line containing the resulting ternary number.

Ejemplos

Ejemplo 1

Loading
Loading