string@s; ll@d[26][26],f[][],a[26],i=0; f[0...25][0..25]=ll_inf; a[0..25]=-1; for(char c:s){ ll b=c-'a'; rep(e,26){ if(a[e]>=0){ f[e][b]d[y][x]?"N ":"Y "); } wt(""); }