Modeling the optimal management of the distribution of profits of an oil and gas company taking into account risks