program Project2; {$APPTYPE CONSOLE} var ch,chr,b,z,i,n: integer; c: char; inp,outp: text; begin assign(inp,'dboard.dat'); assign(outp,'dboard.ans'); reset(inp); rewrite(outp); ch:=0; b:=0; chr:=0; z:=0; readln(inp,n) while not eof(inp)do begin while not eoln(inp)do begin read(inp,c); case c of '0': begin inc(ch); write(outp,'-')end; '1': begin inc(b); write(outp,'-')end; '2': begin inc(chr); write(outp,'2')end; '3': begin inc(z); write(outp,'-')end; end; end; writeln(outp); readln(inp); end; writeln(outp); if (ch=0)or(b=0)or(z=0)or(chr=0)then begin rewrite(outp); writeln(outp,'BAD INPUT LIST'); end else writeln(outp,ch,' ',b,' ',chr,' ',z); close(inp); close(outp); end.