I can't understand why Y can not be higher than X in this following explanation of Richard Feynman in his lecture 
We suppose, however, that there is such a thing—a reversible machine—which lowers one unit of weight (a pound or any other unit) by one unit of distance, and at the same time lifts a three-unit weight. Call this reversible machine, Machine A. Suppose this particular reversible machine lifts the three-unit weight a distance X. Then suppose we have another machine, Machine B, which is not necessarily reversible, which also lowers a unit weight a unit distance, but which lifts three units a distance Y. We can now prove that Y is not higher than X; that is, it is impossible to build a machine that will lift a weight any higher than it will be lifted by a reversible machine. Let us see why. Let us suppose that Y were higher than X. We take a one-unit weight and lower it one unit height with Machine B, and that lifts the three-unit weight up a distance Y. Then we could lower the weight from Y to X, obtaining free power, and use the reversible Machine A, running backwards, to lower the three-unit weight a distance X and lift the one-unit weight by one unit height. This will put the one-unit weight back where it was before, and leave both machines ready to be used again! We would therefore have perpetual motion if Y were higher than X, which we assumed was impossible. With those assumptions, we thus deduce that Y is not higher than X, so that of all machines that can be designed, the reversible machine is the best.

Why is that?
 A: It takes some pondering, but it does make sense.  For clarity, I'll use kg and m just to illustrate the point.  (Note that all I am doing in this answer is giving the above text in my own words, in the hope that you might see why it works from someone else's mind, though I do not claim to be mightier than the great Feynman! :P)
Machine B drops the 1kg weight 1m, and pulls up the 3kg weight by $Y$ (in m).
Now the 3kg weight is dropped from $Y$ meters above the ground to $X$ meters above the ground - i.e. if $Y>X$, then the 3kg weight has dropped by $Y-X$, which means this is giving us some energy/work (we could in principle attach this to another pulley system to lift up something else) - this is what the "obtaining free power" is referring to.
Now the 3kg weight is dropped from $X$ to 0, and using machine A, the 1kg weight is pulled back up to its starting position.  This is because Machine A is reversible - this point is key to the argument.
Now think about what we've just done - we've gotten back to exactly how we started, and have also extracted some energy!  This is a no-no, because it means we could theoretically do this forever and generate infinite energy!
Note that if Machine A were irreversible, then it would (potentially) be ok, because bringing the 3kg weight back from $X$ to 0 would not bring the 1kg block back to its starting position, and we could not keep repeating the above for ever without inputting some external energy.  In that case, it might be allowed that $Y>X$.
What we conclude from this thought experiment is that reversible machines are the most efficient, and further to that, all reversible machines must have the same efficiency.
