问题 I: The Yakumo Family

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

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)1l1r1<l2r2<l3r3nXOR(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_ralal+1al+2ar, and ⊕\oplus means bitwise XOR.

输入格式

The first line contains one integer nnn (3≤n≤2×1053\le n\le 2\times 10^53n2×105), which means the length of aaa.
The next line contains nnn integers, the iii-th integer means the value of aia_iai (0≤ai≤1090\le a_i\le 10^90ai109).

输出格式

One integer, means the value of the equation modulo 998244353998244353998244353.

输入样例 复制

3
1 2 3

输出样例 复制

6