As we all know, Rikka is not good at math. Yuta, her boyfriend, is worried about it. Therefore, he sets an interesting math problem For Rikka to practice.
Given a non-negative integer x, Rikka is required to find three non-negative integers a,b,c that satisfy the following three conditions:
- a + b = x;
-
is a subsequence of
; -
is a subsequence of
.
)
represents the decimal string representation of integer d. For example,
%3D)
"0",
%3D)
"103".
String

is a subsequence of string

if and only if there exists an index sequence

satisfying

.
To avoid the case of no solution, Yuta assumes there is a special choice "-" for c where
)
is equal to the empty string. Under this assumption, a=0, b=9, c=- becomes a valid solution of x=9.
Finding a valid solution is an easy task even for Rikka. Therefore, Rikka wants to increase the difficulty: Rikka wants you to find a valid solution (a,b,c) so that the length of
)
is as large as possible.