#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define me(a,x) memset(a,x,sizeof(a))
#define sf scanf
#define pf printf
#define rep(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=x;i>=y;i--)
#define gcd __gcd
#define pb push_back
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define debug(x) cout<<"x="<<x<<endl
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
const ll llINF=9223372036854775807;
const int maxn=1e5+10;
const double pi=acos(-1.0);
ll gcd(ll a,ll b)
{
    return b?gcd(b,a%b):a;
}
ll lcm(ll a,ll b)
{
    return a/gcd(a,b)*b;
}
using namespace std;

ll n;
ll sum=0;
ll shu[maxn];
ll res;

void solve()
{
    sf("%lld",&n);
    res=1;
    int idx=0;
    rep(i,1,n)
    {
        if(gcd(i,n)==1)
        {
            res=res*i;
            res%=n;
        }
    }
    if(res==1)
    {
        rep(i,1,n)
        {
            if(gcd(i,n)==1)
            {
                idx++;
                shu[idx]=i;
            }
        }
        pf("%d\n",idx);
        rep(i,1,idx)
        {
            pf("%d",shu[i]);
            if(i<idx) pf(" ");
            else pf("\n");
        }
    }
    else
    {
        rep(i,1,n-2)
        {
            if(gcd(i,n)==1)
            {
                idx++;
                shu[idx]=i;
            }
        }
        pf("%d\n",idx);
        rep(i,1,idx)
        {
            pf("%d",shu[i]);
            if(i<idx) pf(" ");
            else pf("\n");
        }
    }
}

int main()
{
//    IOS;
    solve();
    return 0;
}

### Prompt

Generate a CPP solution to the following 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].

### Response

```cpp
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define me(a,x) memset(a,x,sizeof(a))
#define sf scanf
#define pf printf
#define rep(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=x;i>=y;i--)
#define gcd __gcd
#define pb push_back
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define debug(x) cout<<"x="<<x<<endl
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
const ll llINF=9223372036854775807;
const int maxn=1e5+10;
const double pi=acos(-1.0);
ll gcd(ll a,ll b)
{
    return b?gcd(b,a%b):a;
}
ll lcm(ll a,ll b)
{
    return a/gcd(a,b)*b;
}
using namespace std;

ll n;
ll sum=0;
ll shu[maxn];
ll res;

void solve()
{
    sf("%lld",&n);
    res=1;
    int idx=0;
    rep(i,1,n)
    {
        if(gcd(i,n)==1)
        {
            res=res*i;
            res%=n;
        }
    }
    if(res==1)
    {
        rep(i,1,n)
        {
            if(gcd(i,n)==1)
            {
                idx++;
                shu[idx]=i;
            }
        }
        pf("%d\n",idx);
        rep(i,1,idx)
        {
            pf("%d",shu[i]);
            if(i<idx) pf(" ");
            else pf("\n");
        }
    }
    else
    {
        rep(i,1,n-2)
        {
            if(gcd(i,n)==1)
            {
                idx++;
                shu[idx]=i;
            }
        }
        pf("%d\n",idx);
        rep(i,1,idx)
        {
            pf("%d",shu[i]);
            if(i<idx) pf(" ");
            else pf("\n");
        }
    }
}

int main()
{
//    IOS;
    solve();
    return 0;
}

```