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

public class dnaand_ats implements Runnable {
	public static void main(String[] args) {
		new Thread(new dnaand_ats()).start();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void solve() throws IOException {
		int n = nextInt();
		long k = nextLong();
		long val = 1;
		int deg = 0;
		while (val < k && deg < (n + 1) / 2) {
			val *= 4;
			deg++;
		}
		k--;
		if (val >= k) {
			String ans = "";
			for (int i = 0; i < (n + 1) / 2 - deg; i++)
				ans += 'A';
			int len = deg;
			while (len > 0) {
				if (k < val / 4)
					ans += 'A';
				else if (k < val / 2) {
					ans += 'C';
					k -= val / 4;
				} else if (k < val / 4 * 3) {
					ans += 'G';
					k -= val / 2;
				} else {
					ans += 'T';
					k -= val / 4 * 3;
				}
				val /= 4;
				len--;
			}
			out.print(ans);
			for (int i = ans.length() - 1 - (n & 1); i >= 0; i--)
				out.print(ans.charAt(i));
			out.println();
		} else {
			out.println("Impossible");
		}
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			br = new BufferedReader(new FileReader("dnaand.in"));
			out = new PrintWriter("dnaand.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
