const
  s = 'ACGT';
  maxn = 100;
  maxk = 1000000000000000000;

var
  n, i : integer;
  k : int64;
  ans : array[1..maxn] of integer;
begin
  reset(input, 'dnaand.in');
  rewrite(output, 'dnaand.out');
  read(n, k);
  assert((1 <= n) and (n <= maxn));
  assert((1 <= k) and (k <= maxk));
  k := k - 1;
  for i := (n + 1) div 2 downto 1 do begin
    ans[i] := k mod 4;
    ans[n - i + 1] := ans[i];
    k := k div 4;
  end;
  if k > 0 then begin
    writeln('Impossible');
    halt;
  end;
  for i := 1 to n do begin
    write(s[ans[i] + 1]);
  end;
end.