P12711 [HackerEarth] abc string 61
普及
题目描述

Given an integer N,Find how many strings of length N are possible, consisting only of characters { 'A','B' and 'C' } with each character {'A','B' and 'C'} occurs at least once.

Input:
First line of each test case contains number of test cases T. Each test case contains a single integer N.

Output:
For each test case print the expected output. Output may be too large so print it modulo 10^9+7.

Constraints:
1 ≤ T ≤ 10^5
1 ≤ N ≤ 10^9

SAMPLE INPUT
3
2
3
4

SAMPLE OUTPUT
0
6
36

输入格式

见题面

输出格式

见题面

样例输入
3 2 3 4 SAMPLE
样例输出
0 6 36