program x1;
var
z,x:string;
s: set of char = ['0'..'9','a'..'f', 'A'..'F'];
i:integer;
begin
readln (z);
x:='';
for i := 1 to length(z) do
if z[i] in s then if x='0' then x:=z[i]
else x:=x+z[i]
else begin
if length(x)>0 then
writeln(x);
x:='';
end;
writeln(x);
end.