Inverting the Burrows-Wheeler Transform