When I am working on a problem, I never think about beauty but when I have finished, if the solution is not beautiful, I know it is wrong.
The most important lesson to remember is that failure is inevitable, but so is success, so rebound.