This page is still under construction.

Parts of this page are still being built. What you see may change.

Inverse Divisor Sums

Time limit3sMemory limit256 MB

Summary
Print every integer M whose divisor sum equals the given N in increasing order, or none when no such number exists.
Level

Medium7 of 10

Topics
Backtracking, Number theory, Math
Solved
No attempts yet

Problem

Your friend Odd Even is obsessed with number theory. Every time he learns a new operation on numbers he spends hours applying it. Last year he learned Euler's totient function ϕ(n)\phi(n), which counts the positive integers up to nn that are relatively prime to nn, and then computed ϕ(n)\phi(n) by hand for every integer nn from 1 to one million.

Recently he learned that the sum of all divisors of a number NN is given by the following formula.

sum of divisors(N)=∏i=1rpiai+1−1pi−1\text{sum of divisors}(N) = \prod_{i=1}^{r} \frac{p_i^{a_i+1} - 1}{p_i - 1}

Here p1a1,p2a2,…,prarp_1^{a_1}, p_2^{a_2}, \dots, p_r^{a_r} is the factorization of NN into prime factors, each pip_i is different, and aia_i is the largest exponent such that piaip_i^{a_i} divides NN.

Odd Even wants to run the function backwards. Given a positive integer NN he wants every positive integer MM whose sum of divisors is NN, written out in increasing order. Doing that by hand would take far too long, so you decided to write a program for him instead.

Given a positive integer NN, print every integer MM whose sum of divisors is NN in increasing order, or report that no such number exists.

Input

The first line contains the number of test cases TT. Each of the next TT lines contains one integer NN.

  • 1≤T≤1001 \le T \le 100
  • 1≤N≤1091 \le N \le 10^9

Output

For each test case, print every number whose sum of divisors is NN on one line in increasing order, with a single space between consecutive numbers. If no such number exists, print none! without the quotes.

The output can get very long, so collect it and write it out at once instead of printing line by line.

Examples2

  1. Example 1

    Input
    4
    7
    2
    126
    1524
    
    Expected output
    4
    none!
    68 82
    704 1083 1523
    
  2. Example 2

    Input
    6
    1
    3
    4
    5
    6
    12
    
    Expected output
    1
    2
    3
    none!
    5
    6 11