The legs and beak of an egret resemble those of the heron because they