Quantum confinement and phase transition in PbS nanowire: A first principles study