#include using namespace std; vector merge(vector a,int p,int MOD){ if(p==0){ int N=a.size()+1; vector ret(N,1); for(int i=1;i ret(N); for(int i=0;i C(int step,int MOD){ vector three; while(step>0){ three.push_back(step%3); step=step/3; } vector cur={1}; for(int i=0;i>T; string S; vector c; int temp; for(int i=0;i>S; c=C(S.size()-1,9); temp=0; for(int i=0;i