int main()
{
decl
    int temp, fdread, fdwrite, permission, pid, offset, data, iter;
    string filename;
enddecl

begin
    pid=exposcall("Getpid");
    if(pid==3) then
        filename="3.dat";
    endif;
    if(pid==4) then
        filename="4.dat";
    endif;
    if(pid==5) then
        filename="5.dat";
    endif;
    if(pid==6) then
        filename="6.dat";
    endif;
    if(pid==7) then
        filename="7.dat";
    endif;
    if(pid==8) then
        filename="8.dat";
    endif;
    if(pid==9) then
        filename="9.dat";
    endif;
    if(pid==10) then
        filename="10.dat";
    endif;
    if(pid==11) then
        filename="11.dat";
    endif;
    if(pid==12) then
        filename="12.dat";
    endif;
    if(pid==13) then
        filename="13.dat";
    endif;
    if(pid==14) then
        filename="14.dat";
    endif;

    permission=1;
    temp=exposcall("Create",filename,permission);
    fdwrite=exposcall("Open",filename);
    fdread=exposcall("Open","num.dat");
          
    if(fdread>=0 AND fdwrite>=0) then
        offset=(pid-3)*100;
        temp=exposcall("Seek",fdread,offset);

        iter=0;
        while(iter<100) do
            temp=exposcall("Read", fdread, data);
            temp=exposcall("Write", fdwrite, data);
            iter=iter+1;
        endwhile;

        temp=exposcall("Close", fdread);
        temp=exposcall("Close", fdwrite);
    else
        temp=exposcall("Write", -2, "OPEN FAIL");
    endif;
          
    return 0;
end
}