write the output after running through rules