Password Validation

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.

please give a fast reply on submitting i am getting neither WA,AC,CTL,RTE,TLE rather it says internal error occurred I have submitted it 3 times and still it says internal error occurred.

I don’t think that there is any error in your code your code is fine. I have just submitted the code in C++ but it still says Internal error. I have reported this issue to help@codechef.com

@vinay1729 Internal Error is resolved now. Someone has changed the judge by mistake it was causing the error. Now you’ll be able to submit. Thanks for reporting it.

//