南辕北辙

nán yuán běi zhé

to act in a way that defeats one's purpose (idiom)

南

nán

south

辕

yuán

shaft of a cart or carriage

北

běi

north

辙

zhé

rut; track of a wheel (Taiwan pr. [che4])