Stacking transition in rhombohedral graphite