Consider a binary operation
__poj_jax_start__\odot__poj_jax_end__
defined on digits 0 to 9.
__poj_jax_start__\odot__poj_jax_end__
: {0, 1, ..., 9} × {0, 1, ..., 9}
__poj_jax_start__\to__poj_jax_end__
{0, 1, ..., 9}, such that 0
__poj_jax_start__\odot__poj_jax_end__
0 = 0.
A binary operation
__poj_jax_start__\otimes__poj_jax_end__
is a generalization of
__poj_jax_start__\odot__poj_jax_end__
to the set of non-negative integers,
__poj_jax_start__\otimes__poj_jax_end__
:
__poj_jax_start__\mathbb{Z}__poj_jax_end__
0+ ×
__poj_jax_start__\mathbb{Z}__poj_jax_end__
0+ __poj_jax_start__\to__poj_jax_end__
__poj_jax_start__\mathbb{Z}__poj_jax_end__
0+. The result of a
__poj_jax_start__\otimes__poj_jax_end__
b is defined in the following way: if one of the numbers a and b has fewer digits than the other in decimal notation, then append leading zeroes to it, so that the numbers are of the same length;
then apply the operation
__poj_jax_start__\odot__poj_jax_end__
digit-wise to the corresponding digits of a and b.
Let us define
__poj_jax_start__\otimes__poj_jax_end__
to be left-associative, that is, a
__poj_jax_start__\otimes__poj_jax_end__
b
__poj_jax_start__\otimes__poj_jax_end__
c is to be interpreted as (a
__poj_jax_start__\otimes__poj_jax_end__
b)
__poj_jax_start__\otimes__poj_jax_end__
c.
Given a binary operation
__poj_jax_start__\odot__poj_jax_end__
and two non-negative integers a and b, calculate the value of a
__poj_jax_start__\otimes__poj_jax_end__
(a + 1)
__poj_jax_start__\otimes__poj_jax_end__
(a + 2)
__poj_jax_start__\otimes__poj_jax_end__
...
__poj_jax_start__\otimes__poj_jax_end__
(b - 1)
__poj_jax_start__\otimes__poj_jax_end__
b.