OPTIMAL CONTRACT (MORAL HAZARD) PROBLEM FORMULATION IN GAMS

I am doing an independant research on my area regarding Optimal Contracts-In this I am trying to formulate my problem in "Fudenberg & Tirole
model " in DISCRETE DATA SETS ,which is as follows;
image.png
(reference:http://homepages.ulb.ac.be/~plegros/documents/classes/contrats/lectures/lect-simple%20contracting%20and%20reneg.pdf)
image.png
This is similar to a Lagrange Multiplier problem -I am new to GAMS & not an expert on Lagrange.

If anybody could guide me/give some hints on this , I am on ‘Cloud Nine’

Best regards

Abraham