I am facing some doubts trying to understand the illustration my textbook has adopted for the development of the Clausius inequality for thermodynamic cycles.I have attached an image of the content from my textbook. As one could see the author has assumed a closed system connected to a thermal energy reservoir at a constant thermodynamic temperature of TR through a reversible cyclic device.The cyclic device receives heat δQR from the reservoir and supplies heat δQ to the system whose temperature at that part of the boundary is T (a variable) while producing work δWrev.The system produces work δWsys as a result of this heat transfer. In the course of analysis he again assumes, "We now let the system undergo a cycle while the cyclic device undergoes an integral number of cycles."This implies that he is assuming the closed system is undergoing a cycle receiving heat δQ and producing a net amount of work δWsys without rejecting any heat.This is an impractical assumption itself.From the arrangement as shown the system can only produce work in a process absorbing heat δQ and producing a net work of δWsys and not produce work in a continuous cycle.To undergo a cycle it must reject some heat which by assumption is only possible for the given arrangement if the direction of δQ is reversed.Again doing so would require the direction of operation of the reversible cyclic device to be reversed and thus for a cycle of the system to be accomplished, the reversible cyclic device must be reversed. Thus the statement "the system undergoes a cycle while the cyclic device undergoes an integral number of cycles" seems very confusing. Can somebody come up with an explanation behind it?