#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template struct Mint{ static constexpr T mod = MOD; T v; Mint():v(0){} Mint(signed v):v(v){} Mint(long long t){v=t%MOD;if(v<0) v+=MOD;} Mint pow(long long k){ Mint res(1),tmp(v); while(k){ if(k&1) res*=tmp; tmp*=tmp; k>>=1; } return res; } static Mint add_identity(){return Mint(0);} static Mint mul_identity(){return Mint(1);} Mint inv(){return pow(MOD-2);} Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;} Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;} Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;} Mint& operator/=(Mint a){return (*this)*=a.inv();} Mint operator+(Mint a) const{return Mint(v)+=a;} Mint operator-(Mint a) const{return Mint(v)-=a;} Mint operator*(Mint a) const{return Mint(v)*=a;} Mint operator/(Mint a) const{return Mint(v)/=a;} Mint operator-() const{return v?Mint(MOD-v):Mint(v);} bool operator==(const Mint a)const{return v==a.v;} bool operator!=(const Mint a)const{return v!=a.v;} bool operator <(const Mint a)const{return v constexpr T Mint::mod; template ostream& operator<<(ostream &os,Mint m){os<; M solve(Int n,Int pat){ if(n==0) return M(1); Int x=(pat>>0)&1; Int y=(pat>>1)&1; Int z=(pat>>2)&1; Int w=(pat>>3)&1; M res=M(4).pow(n); // res=0; res+=M(2).pow(n-1)*M(4).pow(n); M p(x+y+z+w); M q(4-(x+y+z+w)); if(n>=2){ res+=p*p*(M(2).pow(n-1)-M(1))*M(4).pow(n-2); res+=q*q*(M(2).pow(n-1)-M(1))*M(4).pow(n-2); res-=p*q*(M(2).pow(n-1)-M(1))*M(4).pow(n-2); res-=q*p*(M(2).pow(n-1)-M(1))*M(4).pow(n-2); } // cout<>n; string s; cin>>s; M ans{0}; for(Int p=0;p<8;p++) if(s[p]=='o') ans+=solve(n,p); cout<