#includeusing namespace std; long long length[51];void precalc(){length[0] = 1;for(int i = 1; i=length[generations])skip -= length[generations];else if(dragonCurve[i] == 'X'){return expand(X, generations-1, skip);}else if(dragonCurve[i] =='Y'){return expand(Y, generations-1,skip);}}else if(skip>0)--skip;elsereturn dragonCurve[i];} return '#';} int main(){string t;int C, a,b,c;cin>>C;precalc();wh..