Quark masses using twisted-mass fermion gauge ensembles