#include using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair((a),(b)) #define pb(a) push_back((a)) #define all(x) (x).begin(),(x).end() #define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x)) #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o< tmp(n+1); tmp[0] = 1; repl(i,1,n) tmp[i] = tmp[i-1]*10%mod; tmp[0] = 1; rep(i,(n+1)/2){ rep(j,10) if(i!=0 || j>0){ int x = s[i], y = s[n-i-1]; if(jy && j==x){ countjust = false; break; } } ans %=mod; } return (ans + countjust)%mod; } int main(){ cin>>s; n =s.size(); rep(i,n) s[i] -= '0'; mod = DOM; cout << solve() << endl; mod = MOD; cout << solve() << endl; return 0; }