Program zadatak_1;
uses strutils;
var s, c1, c2, m : string;
    a1, a2, i, p : longint;
begin
    readln(s);
    c1 := s[1];
    c2 := s[2];
    readln(m);
    p := pos(' ', m);
    val(leftstr(m, p - 1), a1);
    val(rightstr(m, length(m) - p), a2);
    if (a1 = a2) or (a1 + 1 = a2) or (a1 - 1 = a2) then
    begin
        if a1 > a2 then
        begin
        for i := 1 to (a1 + a2) do
            if i mod 2 = 1 then
                write(c1)
            else write(c2);
        end
        else begin
            for i := 1 to (a1 + a2) do
                if i mod 2 = 1 then
                    write(c2)
                else write(c1);
        end;
    end
    else writeln('nemoguce');
end.