Input (grade 8): If the cyclic process moves clockwise around the loop, then it represents a heat engine, and W will be positive.
Output (grade 8): If it moves counterclockwise then it represents a heat pump, and W will be negative.