Write the input file