print"$_\n"x grep/test$/,@names; say for grep/test$/,@names;