Former judge András Baka elected Hungarian president