Uses
Dos;
Function driveexist(ch : Char) : Boolean;
begin
DriveExist := disksize(ord(upcase(ch)) - 64) <> - 1;
end;
Const
exist : Boolean = True;
ch : Integer = 67;
lastdrive : Char = ' ';
begin
While LastDrive = ' ' do
begin
if driveexist(Chr(ch)) then
Inc(Ch)
else
LastDrive := Chr(Ch - 1);
end;
Writeln(LastDrive);
end.