#include <vector>
#include <string>
#include <iostream>
#include <iomanip>

using namespace std;


int main()
{
    int n;
    cin >> n;
    if (n%4)
    {
        cout << "prime\n";
        return 0;
    }
    int two = 0;
    while(n%2 == 0)
    {
        two++;
        n /= 2;
    }
    vector<int> ps;
    for(int d = 3; n > 1 && d*d <= n; d+=2)
    {
        while(n%d == 0)
        {
            ps.push_back(d);
            n /= d;
        }
    }
    if (n > 1) ps.push_back(n);
    if (ps.size() <= 1)
    {
        cout << "single\n";
        for(int i = 0; i < two-1; ++i) cout << "2 ";
        cout << (ps.size()==0 ? 2 : 2*ps[0]) << endl;
    }
    else
    {
        cout << "many\n";
        for(int i = 0; i < two-2; ++i) cout << "2 ";
        cout << 2*ps[0] << " ";
        n = 1;
        for(int i = 1; i < ps.size(); ++i) n *= ps[i];
        cout << 2*n << endl;
        for(int i = 0; i < two-1; ++i) cout << "2 ";
        cout << 2*n*ps[0] << endl;
    }
}


