Optimization of work and rest modes of flight crew members in order to improve flight safety in civil aviation