How to fix this error?

Hi everyone, trying to replicate a paper I’m getting this error:

“Calling Dynare with arguments: none, Starting preprocessing of the model file, WARNING: A parameter was used with a lead or a lag in the model block, Substitution of exo lags: added 2 auxiliary variables and equations, ERROR: There are 30 equations but 16 endogenous variables!”.

Can anyone tell me how to fix it? Thank you!

Here is the code

close all;
%list of variables
var i rr pik pic piq w mc c l y e k I q;
varexo s_e s_k a g;

%list of parameters
parameters sig x phi beta delta eps rhose rhosk rhoa rhog alpha alphal alphae alphak teta phip phiy 
S C pcpqratio Cq Ce pir W Q E K L A G Y F;

%calibrate parameters
sig=1;
x=0.023;
phi=1;
beta=0.99;
delta=2/3;
eps=1;
rhose=(0.5)/4;
rhosk=(0.5)/4;
rhoa=(0.5)/4;
rhog=(0.5)/4;
alpha=1;
alphal=1/4;
alphae=1/4;
alphak=1/4;
phip=0; 
phiy=1.5;
teta=0.75;

model(linear);

%Steady state rations
C=teta*Ce*Cq(-1);
Ce=x*C;
%S=pe/pq
pcpqratio=S;
Cq=(1-x)*C; 
%S*C=x*pc*c;
1=beta*(rr+1-sig);
pir=Q-S*E-W*L-rr*S*K;
W=C*L^phi;
Q=((A*E)^alphae)*(L^alphal)*(K^alphak);
S*E=alphal*((eps-1)/eps)*Q;
E=alphae*((eps-1)/eps)*Q;
K=(Q-C-S*E-G)/(sig*S*k);
L^(phi+1)=(((eps-1)*alphal)/eps)*(Q/C);

%Eq.1 
rr=(1-beta*(1-sig))*rr(+1)+pik(+1);
%Eq.2
c=c(+1)-(i-pic(+1));
%Eq.3 
w=c+phi*l+x*s_e;
%Eq.4 
i=phip*piq+phiy*y;    
%Eq.5 
l=s_e+e-w;
%Eq.6
(S*C)*(c+x*s_e)+(S*I)+G*g=Q*q-(S*E)*e; 
%Eq.7
sig*I=k(+1)-(1-sig)*K;
%Eq.8 
q=a+alphal*l+alphae*e+alphak*k;
%Eq.9 
piq-beta*piq(+1)=(((1-beta*teta)*(1-teta)*alpha)/(teta*(alpha+(1-alpha)*eps)))*mc; 
%Eq.10 
mc=((1-alpha)/alpha)*q+F;  
%Eq.11 
F=-1/alpha*(a-alphae*s_e-alphal*w-alphak*(rr+s_k));
%Eq.12
(S*Y)*(y+x*s_e)=Q*q-(S*E)*(s_e+e);
%Eq.13
pic=piq+x*delta*s_e;
%Eq.14
pik=piq+delta*s_k;
%Eq.15
s_e=rhose*s_e(-1)+e;
%Eq. 6
s_k=rhosk*s_k(-1)+e;
%Eq.17
a=rhoa*a(-1)+e;
%Eq.18
g=rhog*g(-1)+e;

Why does your model contain equations that consist purely of parameters? These objects need to be defined outside of the model block.