Ordering words to fit in a given string
Pyth, 20 24 bytes
My first attempt on Pyth :)
Jcw;FG.ptJI:hJj&quot;.*&quot;G0jdG

How it works:
Jcw;FG.ptJI:hJj&quot;.*&quot;G0jdG
Jcw                         assign(&quot;J&quot;,chop(input()))
    FG.ptJ                  for G in permutations(tail(J)):
          I:hJj&quot;.*&quot;G0        if match(head(J),join(&quot;.*&quot;,G)):
                     jdG      print(join(&quot; &quot;,G))

Notes: it takes a long time in the third example (dababbabadbaccbcbaaacdacdbdd aa bb cc dd ba ba ba ab ac da db dc).