S Korea gives undocumented foreign workers chance