Symlinks Circulaires

Étant donné le parcours d’un système de fichiers, donner les chaines de symlinks.

Input

  • Une liste de commande et leurs outputs dans un shell fictif, ligne par ligne
  • Profondeur P du système : 9 ≤ P ≤ 15

Output

  • Les tailles par ordre croissant des chaînes de symlinks, sur une même ligne.

Exemples

Input :

$ cd /
$ ls
618333 bgywenou
818238 jkngy
499182 mxeucthmfi
l njkovtjfck -> /rmmviu
909485 oevggzegp
253577 ppbseyd
l rmmviu -> /njkovtjfck

Output :

2

Input :

$ cd /
$ ls
l icgyzn -> /ixqjhfphup/hyurxshea/lkxrznwi/ilqrwx
d ixqjhfphup
206389 lkwdq
l qcxiuo -> /wumhsl
l redqffdm -> /icgyzn
d tsrtj
693969 vkiaimkpl
113550 vudylkj
l wumhsl -> /qcxiuo
551330 wuruknr
464790 yfvlbtbs
$ cd tsrtj
$ ls
275357 hbafgtgq
989390 teyll
$ cd ..
$ cd ixqjhfphup
$ ls
d hyurxshea
564319 itypgbfh
364955 mwktptx
599633 rwzylmp
557420 ypoqedypof
$ cd hyurxshea
$ ls
d lkxrznwi
241480 omgkasnvkj
849061 zmfprzs
$ cd lkxrznwi
$ ls
807927 bpfhrjyzmn
l ilqrwx -> /redqffdm
986326 ioyuif
697239 wfdzg
789670 wxhlxmxlb
$ cd ..
$ cd ..
$ cd ..

Output :

2 3

I/O SU

Évènement organisé par ALIAS