To design the majority gate