The second law of thermodynamics states that spontaneous processes, like heat flowing from hot to cold, have a particular direction and cannot spontaneously reverse without an external input. Heat engines and heat pumps operate between a high and low temperature reservoir according to this law. The Kelvin-Planck statement specifies that a heat engine cannot produce work using only one reservoir, while the Clausius statement says a heat pump cannot transfer heat from cold to hot without an external input. Violating either statement would create a perpetual motion machine.