Whenever there is lack of work or lack of funds requiring a reduction in the number of employees of the City, the required reduction shall be made in such position classes as the appointing authority shall designate. Employees shall be laid off in the inverse order of their relative length and quality of service. Within each affected class, all temporary employees shall be laid off before provisional employees, all provisional employees before probationary employees, and all probationary employees before permanent employees.