import java.io.*; import java.util.*; public class Main_yukicoder3015 { private static Scanner sc; private static Printer pr; private static void solve() { int a = sc.nextInt(); int b = sc.nextInt(); long hash = 1; TreeSet hs = new TreeSet<>(); for (int i = 0; i < 1_000_000; i++) { Pair tmp = new Pair(hash, i); hs.add(tmp); Pair l = hs.lower(tmp); if (l != null && l.a == tmp.a) { // pr.printf("%d %d\n", a, b); // pr.println(l); // pr.println(tmp); StringBuilder ret1 = new StringBuilder(); for (int j = 0; j <= i; j++) { ret1.append('a'); } StringBuilder ret2 = new StringBuilder(ret1); ret1.setCharAt(i - l.b, 'b'); ret2.setCharAt(i - tmp.b, 'b'); pr.println(ret1); pr.println(ret2); break; } hash *= a; hash %= b; } } private static class Pair implements Comparable { long a; int b; Pair(long a, int b) { this.a = a; this.b = b; } @Override public int compareTo(Pair o) { if (a == o.a) { return Integer.compare(b, o.b); } return Long.compare(a, o.a); } @Override public int hashCode() { return Long.hashCode(a); } @Override public boolean equals(Object obj) { return a == ((Pair)obj).a && b == ((Pair)obj).b; // return a == ((Pair)obj).a; } @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(a); ret.append(','); ret.append(b); return ret.toString(); } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }