alt

import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) {
		InputReader in = new InputReader();
		PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        StringBuilder sb = new StringBuilder();
        int h = (int)(Math.log(n + 1) / Math.log(2));
        int k = n - ((1 << h) - 1);
        for(int i = 0; i < h; ++i)
            sb.append(((k >> i) & 1) == 1 ? "G" : "N");
        out.println(sb.reverse());
		out.close();
	}
}

class InputReader {
	BufferedReader buf;
	StringTokenizer tok;

	InputReader() {
		buf = new BufferedReader(new InputStreamReader(System.in));
	}

	boolean hasNext() {
		while (tok == null || !tok.hasMoreElements()) {
			try {
				tok = new StringTokenizer(buf.readLine());
			} catch (Exception e) {
				return false;
			}
		}
		return true;
	}

	String next() {
		if (hasNext())
			return tok.nextToken();
		return null;
	}

	int nextInt() {
		return Integer.parseInt(next());
	}
}