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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Codeforces {

    static FastScanner sc;
    static PrintWriter out;
    static int mod = (int) (1e9+7);

    public static void main(String[] args){
        sc = new FastScanner();
        out = new PrintWriter(System.out);

        int t = 1;
        while(t-- > 0){
            solve();
        }

        out.close();
    }

    private static void solve() {

        int n = sc.nextInt();

        ArrayList<Integer> arr = new ArrayList<>();
        long product = 1l;
        for(int i=1; i<n; i++){
            if(findGcd(i, n) == 1) {
                arr.add(i);
                product %= n;
                product *= i%n;
            }
        }
        int val = (int) (product%n);
        if(val != 1){
            out.println(arr.size()-1);
            for(int i=0; i<arr.size(); i++){
                if(arr.get(i) == val)
                    continue;
                out.print(arr.get(i) + " ");
            }
        }
        else{
            out.println(arr.size());
            for(int i=0; i<arr.size(); i++){
                out.print(arr.get(i) + " ");
            }
        }
        out.println();
    }

    public static int nCr(int n, int k) {
        int C[] = new int[k + 1];

        // nC0 is 1
        C[0] = 1;

        for (int i = 1; i <= n; i++) {
            // Compute next row of pascal
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = (C[j]%mod + C[j - 1]%mod)%mod;
        }
        return C[k]%mod;
    }

    private static int findLcm(int n, int m) {

        return n*m/findGcd(Math.min(n, m), Math.max(n, m));
    }

    private static int findGcd(int n, int m) {
        if(n == 0)
            return m;
        return findGcd(m%n, n);
    }

    private static long findLcm(long n, long m) {

        return n*m/findGcd(Math.min(n, m), Math.max(n, m));
    }

    private static long findGcd(long n, long m) {
        if(n == 0)
            return m;
        return findGcd(m%n, n);
    }

    public static void intSort (int[] arr) {
        //First ruffle

        int n = arr.length;
        Random r = new Random();
        for (int i=0; i<arr.length; i++) {
            int j = r.nextInt(n);
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }

        //then sort
        Arrays.sort(arr);
    }

    public static void longSort (long[] arr) {
        //First ruffle

        int n = arr.length;
        Random r = new Random();
        for (int i=0; i<arr.length; i++) {
            int j = r.nextInt(n);
            long temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }

        //then sort
        Arrays.sort(arr);
    }

    public static void sort2dArray (long[][] arr) {
        Arrays.sort(arr, (a, b) -> {
            if (a[0] == b[0])
                return (int) (a[1] - b[1]);
            return (int) (a[0] - b[0]);
        });
//        Arrays.sort(arr, (a, b) -> {
//            if (a[1] == b[1])
//                return (int) (a[0] - b[0]);
//            return (int) (a[1] - b[1]);
//        });
    }

    public static void sort2dArray (int[][] arr) {
//        Arrays.sort(arr, (a, b) -> {
//            if (a[1] == b[1])
//                return (int) (a[0] - b[0]);
//            return (int) (a[1] - b[1]);
//        });
        Arrays.sort(arr, (a, b) -> {
            if (a[0] == b[0])
                return (int) (a[1] - b[1]);
            return (int) (a[0] - b[0]);
        });
    }

    public static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

}