$"=''; $b=($a=1e9)+7; @N=<>=~/./g; $K=@N; $t+="@N[0..$K-1>>1,reverse 0..($K>>1)-1]"le"@N"; --$N[0]; $h="@N[!$N[0]..$K-1>>1]"; exec"python -c' print (pow(10,($K-1)//2,$a)+pow(10,$K//2,$a)+$t+$a-2+$h)%$a print (pow(10,($K-1)//2,$b)+pow(10,$K//2,$b)+$t+$b-2+$h)%$b '"