Foreach merge