n=gets.size-1 [0,7].map{|v|p (-($_[0,w=n/2].reverse>$_[m=n-w,n]?2:1)+10**w+$_[0,m].to_i).%10**9+v}