Byfibonacci
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Fibonacci Sequence:
Fibonacci representation : Any natural number  can be expressed as the sum of a set of different Fibonacci numbers.

In particular: f_0 and f_1 are two different Fibonacci numbers.

For example: indicates that  corresponds to at least two Fibonacci representations.

The value of the Fibonacci representation : defined as the product of the Fibonacci numbers in the representation .

For example: . In this representation, the value  is: .

With the above definitions, now, find the sum of all Fibonacci representations’ value of a given number .

To simplify the question, please output the answer modulo lovely .

输入描述:

The first line contains a positive integer .

The next T line, each line has a natural number .

输出描述:

The output should contain  lines, each line with an integer, which represents the value of the answer modulo lovely .

示例1

输入

复制
1
7

输出

复制
21

说明

(Hint: 7=5+2=5+1+1=3+2+1+1, then 5*2+5*1*1+3*2*1*1=21)