In what year did Germany become a republic