Test for short strings!
procedure is_OK(x)
every i:=1 to *x-1 do
if x[i]>>x[i+1] then fail
return x
endprocedure forgotten_algorithm(x)
repeat
{ x[?*x] :=: x[?*x]
if is_OK(x) then return x
}
endprocedure main()
repeat {x:=read(); write(forgotten_algorithm(x))}
end
----
Kazimir Majorinc, Zagreb, Croatia
