debug reformat input document