Euler proved in 1776 that every rotation of a 3-dimensional body can be realized as a sequence of three rotations around two given axes. If we allow sequences of an arbitrary length, such a decomposition will not be unique. It is then natural to ask a question about decompositions that minimize the total angle of rotation. In the talk we present a solution to this problem. Orientation of Kepler space telescope is controlled with reaction wheels. In 2013, two of these wheels failed, and as a result Kepler may now be rotated only around two axes. Our theorem provides optimal algorithms for Kepler's attitude control. Other possible applications arise in quantum information theory, where transformations on a single qubit are described by the group SU(2), which is closely related to SO(3).