I am self-studying optimization and I came across the following problem in an example

$$begin{array}{rl}max_{w,z} & z quad text { s.t.} \ f_{j}left(w_{1}, w_{j}right)-z & geq 0, quad(2 leq j leq N)end{array} \begin{aligned} sum_{i=1}^{N} w_{i} &=1 \ w_{j} & geq 0 quad(2 leq j leq N) end{aligned}$$

where $f_j$ are concave functions.

The First Order Condition provided in the solution for the optimal point $w_j^*$ are the following:

$$begin{aligned} 1-sum_{j=2}^{N} lambda_{j} &=0 \ lambda_{j} frac{partial f_{j}left(w_{1}^{*}, w_{j}^{*}right)}{partial w_{j}} &=gamma quad j=2, ldots, N end{aligned}$$

$$sum_{j=2}^{N} lambda_{j} frac{partial f_{j}left(w_{1}^{*}, w_{j}^{*}right)}{partial w_{1}}=gamma \

lambda_{j}left(f_{j}left(w_{1}^{*}, w_{j}^{*}right)-zright)=0 quad j=2, ldots, N$$

for some $gamma,lambda_j$, for $jin(N)$.

Can someone explain how these conditions are derived or point out some reference from which I could derive these? Thanks a lot