Characterizing Mars' magnetotail topology with respect to the upstream interplanetary magnetic fields