f=$(if $(word 10,$1),,$(if $d,$(info $(subst $z ,,$(subst 0,,$(foreach i,4 3 2 1,$(words $($i)))))),$(call f,$1 x,$1,$2,$3))$(call f,$1 x,$2,$3,$4)) 1=x d=$2 $f d=$3 $f d=$4 $f