a=gets[/.{#{(n=$_.size)/2}}/].to_i-($&.reverse>$'?2:1)+10**(n+~n/2) p a%M=10**9,a%=M+7