/p{{1 add}if}def[{(%stdin)(r)file 30 string readline exch[exch( )search pop exch pop exch[{def 1 add}{gt p}{eq p}{lt p}{pop add}{exch pop add}]{/g exch def 0/s{( )print}def 0 4 3 index length{2 index 1 index get 8 mod exch 3 index exch 2 add get 8 mod g}for exch}forall pop 3 index 5 index 3 mul add 6 1 roll 2 copy sub]exch not{exit}if}loop]{2{/a exch def 0(\2\10\6){a exch get add 20 mul}forall exch}repeat gt}.sort dup 0 get 0 get length 4 add{s}repeat 1(P Pt W D L F A GD)= exch{1 index =only s dup 0 get print dup 1 7 getinterval{s dup 9 le{s}if =only}forall s 8 get dup -9 ge{s}if dup 0 gt{(+)print}if dup 0 eq{s}if = 1 add}forall
Note that non-ascii characters in the above source code will be escaped (such as \x9f).