always @(a or b or c or d);
begin
{va,vb,vc,vd}={a,b,c,d};
sort2(va,vc);
sort2(vb,vd);
sort2(va,vb);
sort2(vc,vd);
sort2(vb,vc);
{ra,rb,rc,rd}={va,vb,vc,vd};
end
task sort2;
inout [3:0] x,y;
reg [3:0] temp;
//begin
if(x>y)
begin
temp=y;
y=x;
x=temp;
end
//end
endtask
endmodule