var used: Set of Char; s1, s2: string; i: integer; done: boolean; c: char;function IsLetter(c: char): boolean;begin IsLetter := ((c >= 'a') and (c <= 'z')) or ((c >= 'A') and (c <= 'Z'));end;function UpperCase(c: char): char;begin if (c >= 'a') and (c <= 'z') then UpperCase := Chr(Ord(c) - Ord('a') + Ord('A')) else UpperCase := c;end;beginused := [];readln(s1);readln(s2);for i := 1 to length(s1) do if (IsLetter(s1[i])) then include(used, UpperCase(s1[i]));for i := 1 to length(s2) do if (IsLetter(s2[i])) then include(used, UpperCase(s2[i]));done := False;for c := 'A' to 'Z' do if not (c in used) then begin done := True; write(c); end;if not done then write(0);writeln;end.