Deterministic generation of nonclassical state of light