#include #define endl enjoy_codeforces using lint=long long; lint mod=1'000'000'007; void add_eq(lint&x,lint y){x+=y;if(mod<=x)x-=mod;} int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); lint n,m;std::cin>>n>>m; std::vectora(n); for(lint i=0;i>c; if(c=='P')a.at(i)=0; if(c=='D')a.at(i)=1; if(c=='C')a.at(i)=2; if(c=='A')a.at(i)=3; } std::vector>g(n); for(lint i=0;i>u>>v;u--,v--; g.at(u).push_back(v); g.at(v).push_back(u); } std::vectordp(n); for(lint i=0;i