Sorting input file