sort traces Z, N, E