Ran feels boring at home, and wants to propose a math problem with Yukari and Chen!
So here's The Yakumo Family Problem:
Given an integer array aaa, try to calculate the value of the following equation modulo 998244353998244353998244353:
∑1≤l1≤r1<l2≤r2<l3≤r3≤nXOR(l1,r1)×XOR(l2,r2)×XOR(l3,r3)\sum_{1\le l_1\le r_1<l_2\le r_2<l_3\le r_3\le n}XOR(l_1, r_1)\times XOR(l_2, r_2)\times XOR(l_3, r_3)∑1≤l1≤r1<l2≤r2<l3≤r3≤nXOR(l1,r1)×XOR(l2,r2)×XOR(l3,r3)
XOR(l,r)XOR(l,r)XOR(l,r) means al⊕al+1⊕al+2⋯⊕ara_l\oplus a_{l+1}\oplus a_{l+2}\dots\oplus a_ral⊕al+1⊕al+2⋯⊕ar, and ⊕\oplus⊕ means bitwise XOR.