$"=''; $b=($a=1e9)+7; @N=<>=~/./g; $K=@N; $t+="@N[0..$K-1>>1,reverse 0..($K>>1)-1]"le"@N"; --$N[0]; ($x,$y)=`dc -e' A $K 1-2/$a|A $K 2/$a|+$t+$a+2-$a%p A $K 1-2/$b|A $K 2/$b|+$t+$b+2-$b%p '`; exec"python -c' print ($x+@N[0..$K-1>>1])%$a print ($y+@N[0..$K-1>>1])%$b '"