splitting up input into files