function Priority(j0)
    global pi numpr coll xi
    global MatrixIn;
    global ValueCount;
    
    LastJ=j0;
    a = 630360016;
    m = 2147483647;
    for i=1:ValueCount
        J=mod((a*LastJ), m);
        LastJ=J;
        Y(i)=(1/m)*J;
    end;
  
for i = 1:numpr
    xi(i) = i;
end;
%pi = [0.01 0.05 0.1 0.2 0.25 0.39];

coll(1) = 0;
for i = 2:numpr+1
    coll(i) = coll(i-1) + pi(i-1);
end;

for i=1:numpr
    x0=coll(i);
    x1=coll(i+1);
    for j=1:ValueCount
        if Y(j)>x0 && Y(j)<x1
           Y(j)=xi(i);
        end;
    end;
end;

for i=1:ValueCount
    MatrixIn(4,i)=Y(i);
end;

end