var m,p,g,tbm: real;
begin
writeln('nhap diem Mieng: ');
read(m);
writeln('nhap diem 15 phut: ');
read(p);
writeln('nhap diem Giua ky: ');
read(g);
tbm = ( m + 2*p + 2*g)/3
if (tbm >= 8) then
writeln('diem TBM la:', tbm ,' xep loai Gioi');
else if ( tbm > 6.5 and then tbm < 8) then
writeln('diem TBM la:', tbm ,' xep loai Kha');
else if ( tbm > 5 and then tbm < 6.5) then
writeln('diem TBM la:', tbm ,' xep loai TB');
else
writeln('diem TBM la:', tbm ,' xep loai Yeu');
readln;
end.