please see if my solution is ok of this prbolem
program SPIT3;
var
word:string;
Uword,Lword,x,num,Other:integer;
begin
Uword := 0;Lword := 0;num := 0;Other := 0;
read(word);
if length(word) >= 5 then
begin
for x := 1 to length(word) do
begin
if word[x] in ['A'..'Z'] then inc(Uword)
else if word[x] in ['a'..'z'] then inc(Lword)
else if word[x] in ['0'..'9'] then inc(num)
else
begin
if word[x] in [ '_' , '.' , '?' , ',' , '!'] then inc(Other)
else
begin
write('NO');
exit();
end;
end;
end;
if (Uword >= 1) and (Lword >= 1) and (num >= 1) then write('YES')
else write('NO');
end
else write('NO');
end.