Have a look at this post to see how to recreate the original input. As @windson said, the internal order should be preserved.