var a:array[0..31] of string;
 q,r,t:string;
 i,j,m,n:longint;
 input,output:text;
 begin
 assign (input,'input.txt');reset(input);
assign (output,'output.txt');rewrite(output);
 q:='{}';
 for i:=0 to 17 do
begin
a[i]:='{';
for j:=1 to i-1 do
if j=i-1 then a[i]:=a[i]+a[j] else
a[i]:=a[i]+a[j]+',';
a[i]:=a[i]+'}';
end;
readln(input,r);
readln(input,t);
for i:=0 to 15 do
if a[i]=r then m:=i;
for i:=0 to 15 do
if a[i]=t then n:=i;
write(output,a[m+n-1]);
close(input);
  close(output);
  { TODO -oUser -cConsole Main : Insert code here }
end.