The road from Oyler’s home to his school has steps, where his home is at step and his school is at step . Everyday, Oyler starts his journey from step and goes to step . To move from one step to another step, Oyler makes jumps of length that are powers of two. So, from step Oyler can only go to step if is a nonnegative power of (). For example, if he wants to go from step to step , the sequence of steps Oyler crosses can be .
Today the steps of the path were coloured with colours . In particular, step was coloured in colour . Seeing the colourful steps, Oyler came up with a game. Starting from today, on day , Oyler will avoid the steps with color . Thus an interesting problem was born. In how many ways can Oyler make the journey on day ? You need to answer this for each of days . Since the answers will be large, you have to output it modulo
In the first line, you will be given a positive integer , the number of steps. In the next line, you will be given space separated integers, they are the integers .
Output integers in lines. The the integers will be the number of ways Oyler can make the journey on day
10 1 2 1 2 4 6 8 3 3 9
0 24 11 38 98 38 98 44 0 98