I think I’ve solved the problem. In the file wp-admin/post.php line 219 you have to change this:
if ($user_level < $authordata->user_level)
to this:
if ($user_level <= $authordata->user_level && $user_login != $authordata->user_login)
Now, users in the same level only can edit their own posts. Thanks to all for feedback.