You are given a tree with nnn nodes. A character 0\texttt{0}0 or 1\texttt{1}1 is written on each node. You are also given qqq queries. For each query, you need to calculate the number of different palindromic substrings of the string obtained from the simple path from node uuu to node vvv.
We say two strings
sss and
ttt are different if their lengths are different or there exists at least one position
iii satisfying
si≠tis_i \neq t_isi=ti. A palindromic string is a string that reads the same forward or backward.