Problem: Now you get Baby Ehab's first words: "Given an integer n, find the longest subsequence of [1,2, …, n-1] whose product is 1 modulo n." Please solve the problem.

A sequence b is a subsequence of an array a if b can be obtained from a by deleting some (possibly all) elements. The product of an empty subsequence is equal to 1.

Input

The only line contains the integer n (2 ≤ n ≤ 10^5).

Output

The first line should contain a single integer, the length of the longest subsequence.

The second line should contain the elements of the subsequence, in increasing order.

If there are multiple solutions, you can print any.

Examples

Input


5


Output


3
1 2 3 

Input


8


Output


4
1 3 5 7 

Note

In the first example, the product of the elements is 6 which is congruent to 1 modulo 5. The only longer subsequence is [1,2,3,4]. Its product is 24 which is congruent to 4 modulo 5. Hence, the answer is [1,2,3].

Solution (in CPP):

Solution:
// Umang_US

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define pob pop_back
#define vi vector<ll>
#define mp make_pair
#define sz size()
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define maxx 2*100005
#define sec second
#define fi first
#define be begin()
#define en end()
#define sortv(v) sort(v.begin(),v.end());
#define sortr(v) sort(v.rbegin(),v.rend());
#define w() ll _;cin>>_;while(_--)
#define edge pair<ll,ll>
#define pq priority_queue<ll>
#define mod 1000000007
#define Endl "\n"
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define lb(v,x) std::lower_bound(v.begin(),v.end(),x)
#define ub(v,x) std::upper_bound(v.begin(),v.end(),x)
  
using namespace std;

void init_code(){
    fast;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE
}

ll f[maxx];

void solve()
{
    ll n;
    cin>>n;

    ll i,j;

    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            f[i] = 1;
            f[n/i] = 1;
        }
    }

    for(i=2;i<=n;i++)
    {
        if(f[i])
        {
            for(j=2*i;j<=n;j+=i)
            {
                f[j]=1;
            }
        }
    }

   // cout<<f[6]<<endl;

    ll ans=1;
    std::vector<ll> v;
    v.push_back(1);

    for(i=2;i<n;i++)
    {
        if(!f[i])
        {
            ans*=i;
            ans%=n;
            v.pb(i);
        }
    }

    if(ans==1)
    {
        cout<<v.size()<<Endl;
        for(auto j:v)
        {
            cout<<j<<" ";
        }
    }
    else
    {
        cout<<v.size()-1<<endl;
        v.pop_back();
        for(auto j:v)
        {
            cout<<j<<" ";
        }
    }

    cout<<endl;
}

int main()
{
    init_code();
    solve();
    return 0;
}