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.*;

public class Solve {
    static final int MOD = 1000000007;

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

        int t = 1;
        while (t-- > 0)
            solve(in, out);
        out.close();

    }

    private static void solve(Reader in, PrintWriter out) {
            int n=in.readInt();
          ArrayList<Integer> set=new ArrayList<>();
          long product=1;
            for(int i=1;i<n;i++){
                if(gcd(i, n)==1){
                  set.add(i);
                  product = (product*i)%n;
                }
            }
           
            if(product!=1) {
                for(int i=0;i<set.size();i++) {
                    if(set.get(i)==product) {
                        set.remove(i);
                    }
                }
            }
            System.out.println(set.size());
            for(int i:set)System.out.print(i+" ");
            
    }

    private static int upperBound(int[] arr, int key) {
        int low = 0;
        int high = arr.length - 1;

        while (low < high) {
            int mid = low + (high - low) / 2;
            if (arr[mid] <= key) {
                low = mid + 1;
            } else
                high = mid;
        }
        return low;
    }

    private static long power(long n, long p, long m) {

        long result = 1;

        while (p > 0) {
            if (p % 2 == 1)
                result = (result * n) % m;
            n = (n * n) % m;
            p >>= 1;
        }
        return result;
    }

    private static long gcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return gcd(b, a % b);
    }

    private static void shuffleSort(int a[]) {
        Random random = new Random();
        int n = a.length;
        for (int i = 0; i < n; i++) {
            int t = random.nextInt(n);
            int x = a[t];
            a[t] = a[i];
            a[i] = x;
        }
        Arrays.sort(a);
    }

    private static void sieve(int n) {
        boolean[] prime = new boolean[n];
        for (int i = 0; i < n; i++)
            prime[i] = true;
        for (int i = 2; i * i < n; i++) {
            if (prime[i]) {
                for (int j = i * i; j < n; j += i)
                    prime[j] = false;
            }
        }
        for (int i = 2; i < prime.length; i++) {
            if (prime[i])
                System.out.print(i + " ");
        }

    }

    private static void segmentedSieve(int low, int high) {

        int sqrt = (int) Math.sqrt(high);
        int[] prime = new int[sqrt + 1];
        boolean[] arr = new boolean[sqrt + 1];

        for (int i = 0; i <= sqrt; i++)
            arr[i] = true;

        int k = 0;
        for (int i = 2; i <= sqrt; i++) { // generate all prime numbers till square root of high
            if (arr[i]) {
                prime[k] = i;

                k++;
                for (int j = i * i; j <= sqrt; j += i)
                    arr[j] = false;

            }
        }
        // System.out.println(Arrays.toString(prime));

        int diff = high - low + 1; // arr size of required length
        arr = new boolean[diff];
        for (int i = 0; i < diff; i++)
            arr[i] = true;

        for (int i = 0; i < k; i++) { // mark false to multiple of prime numbers in the range of low to high
            int div = (low / prime[i]) * prime[i]; // It gives multiple of prime[i] nearest to low
            if (div < low || div == prime[i])
                div += prime[i];
            for (int j = div; j <= high; j += prime[i]) {
                if (j != prime[i])
                    arr[j - low] = false;
            }
        }
        for (int i = 0; i < diff; i++) { // print prime numbers in the given segment
            if (arr[i] && (i + low) != 1) {
                System.out.print(i + low + " ");
            }
        }
        System.out.println();

    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair o) {
            if (this.a > o.a)
                return this.a - o.a;
            else if (this.a < o.a)
                return this.b - o.b;

            else
                return 0;

        }
    }

    static class Reader {
        BufferedReader br;
        StringTokenizer st;

        public Reader() {
            br = new BufferedReader(new InputStreamReader(System.in));

        }

        String read() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int readInt() {
            return Integer.parseInt(read());
        }

        String readLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {

                e.printStackTrace();
            }
            return str;
        }

        long readLong() {
            return Long.parseLong(read());
        }
        float readFloat(){
            return Float.parseFloat(read());
        }

        double readDouble() {
            return Double.parseDouble(read());
        }

        int[] readIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
                arr[i] = readInt();
            return arr;
        }

        long[] readLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++)
                arr[i] = readLong();
            return arr;
        }

    }
}