Find the displacement of the wedge when m comes out of the wedge. There is no friction any where.