Circular Symlinks

Given the browsing of a file system, give the symlinks chains.

Input

  • A list of commands and their output in a fictive shell, line by line
  • Depth P of the system : 9 ≤ P ≤ 15

Output

  • The sizes in ascending order of the symlinks chains, on the same line.

Examples

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