Problem #376
Infinite XOR
Given a binary array A (consisting of 1's and 0's) of length n\ (=438276543893501974), we define a time-dependent transformation: A[i]^{(t)} = A[i+1]^{(t-1)}\ \oplus\ A[i+2]^{(t-1)} \oplus\ ...\ \oplus\ A[n]^{(t-1)}
where \oplus denotes the bitwise XOR operation. At each time step, the last element of the array becomes 0, A[n]^{(t)} = 0 for all t > 0.
For a configuration of the array A: F(A) = \sum_{t=0}^{\infty} \sum_{i=1}^{n} A[i]^{(t)}
Your task is to compute the sum of F(A) over all 2^n possible configurations of A. Since the answer may be large, report it modulo 998,244,353.