Which happened first in Hitler's rise to power?

Hitler began building up the German military in defiance of the Treaty of Versailles.
Germany retook the Rhineland.
Hitler was appointed chancellor of Germany.
Hitler wrote Mein Kampf while he was in prison.