#include<iostream>
using namespace std;
#define m 1000000007
int main()
{ long long int a;
int c,t;
long long int n;
cin>>t;
while(t--)
{ a=2;c=1;
cin>>n;
for(int i=2;i<=n;i++)
{if(i%2==0)
c=(c<<1)%m;
a=(a+c)%m;
}
cout<<a<<endl;
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbSAxMDAwMDAwMDA3CiBpbnQgbWFpbigpCiB7IGxvbmcgbG9uZyBpbnQgYTsKICAgaW50IGMsdDsKICBsb25nIGxvbmcgaW50IG47CiAgY2luPj50OwogIHdoaWxlKHQtLSkKICB7IGE9MjtjPTE7CiAgY2luPj5uOwoKICBmb3IoaW50IGk9MjtpPD1uO2krKykKICAge2lmKGklMj09MCkKICAgICBjPShjPDwxKSVtOwogICAgIGE9KGErYyklbTsKICAgICB9CiAgICAgY291dDw8YTw8ZW5kbDsKICB9CiAgICByZXR1cm4gMDsKICAgIH0K