SCRIPT
DIM i
DIM j
DIM k,1
DIM m
DIM n,2
DIM q
DIMS t
OPENFILEOUT myf,out.txt
LABEL loop
SET k,k+1
SET m,p(k)
SET n,n*m
SET i,0
LABEL bou
SET i,i+1
SET q,i*n-1
SETS t,%d\ ;i 
PRP q,t
IF ISPRP THEN GOTO a
GOTO bou
LABEL a
PRP q+n,t
IF ISPRP THEN GOTO b
GOTO bou
LABEL b
PRP q+2*n,t
IF ISPRP THEN GOTO c
GOTO bou
LABEL c
PRP q+3*n,t
IF ISPRP THEN GOTO d
GOTO bou
LABEL d
PRP q+4*n,t
IF ISPRP THEN GOTO e
GOTO bou
LABEL e
SETS t,%d,%d,%d\,;k;m;i
WRITE myf,t
GOTO loop