program ChiaDoan; uses crt; const fi='D:\text\ChiaDoan.INP'; fo='D:\text\ChiaDoan.OUT'; var a,v:array[0..1000] of longint; n,s,i,k,d:longint; function test(m:longint):boolean; var s,i:longint; begin i:=0; k:=0; repeat s:=0; inc(k); repeat inc(i); s:=s+a[i] until s>=m; if s <> m then exit(false); v[k]:=i; until i = n; exit(true); end; procedure out; var i,j:longint; begin for i:=1 to k do begin for j:=v[i-1]+1 to v[i] do write(a[j],' '); writeln; end; end; BEGIN clrscr; assign(input,fi); reset(input); assign(output,fo); rewrite(output); readln(n); for i:=1 to n do read(a[i]); for i:=1 to n do s:=s+a[i]; for i:=1 to s do if (s mod i = 0) and (i <> s) then if test(i) then begin out; inc(d); end; if d = 0 then write('KHONG THE CHIA DUOC'); END.