Var s,tmp:string; i,n:integer; flag,word:boolean; function letter (const let:char):boolean; begin if ((let>='a') and (let<='z')) or ((let>='A') and (let<='Z')) then letter:=true else letter:=false; end; begin readln (s); s:=s+' '; n:=length(s); flag:=false; for i:=1 to n do begin if (letter(s[i])) and (not flag) then begin flag:=true; tmp:=''; word:=false; end else if (not letter(s[i])) and (flag) then begin flag:=false; if (word) and (not (tmp='')) then writeln (tmp); end; if (flag) then begin tmp:=tmp+s[i]; if (s[i]='k') then word:=true; end; end; end.
i,n:integer;
flag,word:boolean;
function letter (const let:char):boolean;
begin
if ((let>='a') and (let<='z')) or ((let>='A') and (let<='Z')) then letter:=true
else letter:=false;
end;
begin
readln (s);
s:=s+' ';
n:=length(s);
flag:=false;
for i:=1 to n do
begin
if (letter(s[i])) and (not flag) then
begin
flag:=true;
tmp:='';
word:=false;
end else if (not letter(s[i])) and (flag) then
begin
flag:=false;
if (word) and (not (tmp='')) then writeln (tmp);
end;
if (flag) then
begin
tmp:=tmp+s[i];
if (s[i]='k') then word:=true;
end;
end;
end.