procedure gnat.io.a is s:string(1..9);l:natural;begin get_line(s,l);if l=7 then l:=4;s(3..4):="ng";end if;for i in 0..2**l-1 loop for j in 1..l loop put(s(j..j-1+i/2**(l-j)rem 2));end loop;new_line;end loop;end;
Note that non-ascii characters in the above source code will be escaped (such as \x9f).