Monte carlo simulation of mixing of a multilayered target