var s:string; i,k1,k2,w:byte; word,a:boolean; begin readln(s); k1:=1; word:=true; a:=false; s[length(s)+1]:=' '; for i:=1 to length(s)+1 do begin if i=length(s) then begin k2:=length(s); word:=false; end else if (s[i]=' ') and (word=true) then begin k2:=i; word:=false; end else if s[i]=' ' then begin k1:=i; word:=true; end; if s[i]='a' then a:=true; if (a=true) and (word=false) then begin a:=false; for w:=k1 to k2 do write(s[w]); write(' '); end; end; writeln; end.
var s:string;
i,k1,k2,w:byte;
word,a:boolean;
begin
readln(s);
k1:=1;
word:=true;
a:=false;
s[length(s)+1]:=' ';
for i:=1 to length(s)+1 do
begin
if i=length(s) then begin k2:=length(s); word:=false; end
else if (s[i]=' ') and (word=true) then begin k2:=i; word:=false; end
else if s[i]=' ' then begin k1:=i; word:=true; end;
if s[i]='a' then a:=true;
if (a=true) and (word=false) then
begin a:=false;
for w:=k1 to k2 do
write(s[w]);
write(' ');
end;
end;
writeln;
end.