today holiday residence hall Oleh arrive honor girl give stre Oleh like gift lot immediately think offer good friend follow problemyou give stre s length n consist 17 lowercase Latin letter b c ldot p q question mark and q query each query define set pairwise distinct lowercase 17 letter latin alphabet replace question mark stre sThe answer query sum number distinct substring palindrome string obtain original string s replace question mark available character the answer calculate modulo 998244353pay attention two substring different start end position stre different so number different substring palindrome string aba 4 b abaconsider example replace question mark letter for example string abaee query b string ababaee abaaaee strings pizza abaee abacaba abafee aba47ee abatreerecall palindrome string read leave right right leave