Xsquare and Interesting Sequences
Practice
4.8 (4 votes)
Mathematics
Open
Approved
Easy
Mathamatics
Problem
43% Success 8586 Attempts 20 Points 3s Time Limit 256MB Memory 1024 KB Max Code

Xsquare get bored playing with the arrays all the time. So,he decided to buy a new character set to play with. Xsquare's character set contains only lower case alphabets more specifically characters from 'a' to 'z' (both inclusive). Xsquare was playing with this new character set and formed some interesting continuous sequences of characters.

for ex :

ioi
cheffehc
bab
codeedoc
radar

Xsquare called this sequences interesting as these sequences remains same even after reversing. Come on , you are already familiar with these sequences. If in case you are not. Please, Have a look at this link

Fascinated with these sequences, Xsquare starts thinking how many distinct interesting sequences of length N are possible if he would have infinite number of each character in the character set.

Xsquare thinks he is very good at counting and starts counting the number of such sequences for a given length N on his fingers.

Can you help him by verifying his answer. Please calculate the number of sequences modulo (109 + 9)

Input

First line of input contains a single integer T denoting the number of test cases. First and only line of each test case contains a single integer N denoting the length of the sequences.

Output

Output consists of **T** lines, one line per test cases containing the required answer.

Constraints

  • 1<=T<=105
  • 1<=N<=1018

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
27 votes
Tags:
Brute-force searchMathematicsApprovedEasy
Points:20
9 votes
Tags:
OpenAlgorithmsApprovedEasyMathamatics
Points:20
7 votes
Tags:
Ad-HocMathematicsOpenApprovedEasy