General n-trailer, differential flatness and equivalence