var f1,f2:text;
n,i:word;
a:array[0..10000] of string;
st:string;
begin
assign(f1,'Dulieu.txt');reset(f1);
assign(f2,'Ketqua.txt');rewrite(f2);
n:=0;
while not(eof(f1))=true do
begin
inc(n);
readln(f1,a[n]);
write(f2,a[n]);
end;
for i:=1 to n do write(f2,#13#10,upcase(a[i]));
for i:=1 to n do
begin
st:=a[i];
while pos(' ',st)<>0 do delete(st,pos(' ',st),1);
write(f2,#13#10,st);
end;
for i:=1 to n do
begin
st:=a[i];
while pos('a',st)<>0 do st[pos('a',st)]:='A';
write(f2,#13#10,st);
end;
close(f1);close(f2);
end.