Finite groups with S-quasinormally embedded or SS-quasinormal subgroups