Greens and far-right AfD excluded from election ticket in two German states