DongDong is fond of numbers, and he has a positive integer P. Meanwhile, there is a rule that is:

A positive integer D that satisfies the following rules:

1. D is one of the factors of P

2. D and P have a same bit at least under the binary system.

So DongDong wants to know how many positive integers D there are.

The first line contains a positive integer T (T<=1000), which means the number of test cases. Then comes T lines, each line contains a positive integer P (1<=P<=1000000000).

For each test case, print the number of positive integers D that satisfies the rules.

```
2
1
10
```

```
1
2
```