reduce: rename stdout to print to avoid name clash