repeat
   s$ = input
   until s$ = ""
   if len s$ > 2
      w$[] &= s$
   .
.
func search s$ .
   max = len w$[] + 1
   while min + 1 < max
      mid = min + (max - min) div 2
      h = strcmp w$[mid] s$
      if h = 0
         return 1
      elif h < 0
         min = mid
      else
         max = mid
      .
   .
   return 0
.
for w$ in w$[]
   w0$ = w$
   out$ = w$
   l = len w$
   for i to l - 1
      w$ = substr w$ 2 (l - 1) & substr w$ 1 1
      if strcmp w$ w0$ <= 0
         break 1
      .
      if search w$ <> 1
         break 1
      .
      out$ &= " -> " & w$
   .
   if i = l
      print out$
   .
.
# the content of unixdict.txt 
input_data
10th
ate
eat
tea
