Merkel wins fourth term, hard right gains foothold in parliament