A new type of CP symmetry, family replication and fermion mass hierarchies