$a=@a[/\d+/g].="F $`$& "for<>;{map{/ (.) (.+) /,$$1eq$$2or$$1=$$2=y/F/T/,redo}@a}print@a