Charmed and bottom baryons: a variational approach based on heavy quark symmetry