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 JAVA):

Solution:
import java.io.*;
import java.util.*;

/**
 * fuck long type
 */
 
public class A{
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }
    // main solver
    static class Task{

        double eps= 0.00000001;
        static final int MAXN = 10000001; 
       
        // stores smallest prime factor for every number 
        static int spf[] = new int[MAXN]; 

        // Map<Integer,Set<Integer>> dp= new HashMap<>();
        
        // Calculating SPF (Smallest Prime Factor) for every 
        // number till MAXN. 
        // Time Complexity : O(nloglogn) 
        public void sieve() 
        { 
            spf[1] = 1; 
            for (int i=2; i<MAXN; i++) 
        
                // marking smallest prime factor for every 
                // number to be itself. 
                spf[i] = i; 
        
            // separately marking spf for every even 
            // number as 2 
            for (int i=4; i<MAXN; i+=2) 
                spf[i] = 2; 
        
            for (int i=3; i*i<MAXN; i++) 
            { 
                // checking if i is prime 
                if (spf[i] == i) 
                { 
                    // marking SPF for all numbers divisible by i 
                    for (int j=i*i; j<MAXN; j+=i) 
        
                        // marking spf[j] if it is not  
                        // previously marked 
                        if (spf[j]==j) 
                            spf[j] = i; 
                } 
            } 
        } 
        
        // A O(log n) function returning primefactorization 
        // by dividing by smallest prime factor at every step 
        public List<Integer> getFactorization(int x) 
        { 
            // if(dp.containsKey(x)) return dp.get(x);
            List<Integer> ret = new ArrayList<>(); 
            while (x != 1) 
            { 
                ret.add(spf[x]); 
                x = x / spf[x]; 
            } 
            // dp.put(x,ret);
            return ret; 
        } 
        // function to find first index >= x 
        public int lowerIndex(List<Integer> arr, int n, int x) 
        { 
            int l = 0, h = n - 1; 
            while (l <= h)  
            { 
                int mid = (l + h) / 2; 
                if (arr.get(mid) >= x) 
                    h = mid - 1; 
                else
                    l = mid + 1; 
            } 
            return l; 
        } 
        
        // function to find last index <= y 
        public int upperIndex(List<Integer> arr, int n, int y) 
        { 
            int l = 0, h = n - 1; 
            while (l <= h)  
            { 
                int mid = (l + h) / 2; 
                if (arr.get(mid) <= y) 
                    l = mid + 1; 
                else
                    h = mid - 1; 
            } 
            return h; 
        } 
        
        // function to count elements within given range 
        public int countInRange(List<Integer> arr, int n, int x, int y) 
        { 
            // initialize result 
            int count = 0; 
            count = upperIndex(arr, n, y) -  
                    lowerIndex(arr, n, x) + 1; 
            return count; 
        }
        
        public void solve(InputReader in, PrintWriter out) {
            int n=in.nextInt();
            List<Integer> res= new ArrayList<>();
            long prod=1;
            for(int i=1;i<=n-1;i++){
                if(_gcd(i,n)==1) {
                    prod= (prod*i)%n;
                    res.add(i);
                }
            }
            if(prod!=1) out.println(res.size()-1);
            else out.println(res.size());
            for(int i: res){
                if(prod!=1 && i==prod) continue;
                out.print(i+" ");
            }
            out.println();

        }
        public boolean check(int a){
            int sqrt= (int)Math.sqrt(a);
            return sqrt*sqrt==a;
        }
        public int khanh(int A[], int N)
        {
            int one = 0;
            for (int i = 0; i < N; i++)
            if (A[i] == 1)
                one++;
            if (one > 0) return N - one;
        
            int minimum = Integer.MAX_VALUE;
            for (int i = 0; i < N; i++) {
                
                int g = A[i];
                for (int j = i + 1; j < N; j++) {
                    g = _gcd(A[j], g);
                    if (g == 1) {
                    minimum = Math.min(minimum, j - i);
                    break;
                    }
                }
            }
        
            if (minimum == Integer.MAX_VALUE) 
            return -1;
            else
            return N + minimum - 1; 
        }
        public int _gcd(int a,  int  b)
        {
        
            if(b == 0) {
                    return a;
            }
            else {
                return _gcd(b, a % b);
            }
        }

    }

    static class Point {
        int x, y;
        public Point(int x, int y){
            this.x= x;
            this.y= y;
        }
    }

    static class Pair implements Comparable<Pair>{
        public long val;
        public int idx;
        public Pair(long val, int idx){
            this.val=val;
            this.idx=idx;
        }
 
        @Override
        public int compareTo(Pair o) {
            if(this.val!=o.val) return (int)(this.val-o.val);
            else return this.idx-o.idx;
        }
    }
    // fast input reader class;
    static class InputReader {
        BufferedReader br;
        StringTokenizer st;
 
        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream));
        }
 
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                String line = null;
                try {
                    line = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (line == null) {
                    return null;
                }
                st = new StringTokenizer(line);
            }
            return st.nextToken();
        }
 
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        public double nextDouble(){
            return Double.parseDouble(nextToken());
        }
        public long nextLong(){
            return Long.parseLong(nextToken());
        }
    }
}