Start with the following:

SQL> col res format a27
SQL> with
2 data as (
3 select lpad(chr(ascii('A')+level-1),
4 trunc(dbms_random.value(2,5)),
5 chr(ascii('A')+level-1)) val
6 from dual
7 connect by level <= 10
8 ),
9 numbered as (
10 select row_number() over (order by val) rn,
11 count(*) over () cnt,
12 val
13 from data
14 )
15 select replace(substr(sys_connect_by_path(rn||'. '||val,'/'),2),'/',' ') res
16 from numbered
17 where rn = cnt
18 connect by prior rn = rn-1
19 start with rn = 1
20 /
RES
---------------------------
1. AA 2. BBB 3. CC 4. DDDD
5. EEEE 6. FF 7. GG 8. HHHH
9. II 10. JJ
1 row selected.

Regards

Michel