templates input and output