Parses input, outputs thread files