y->pavl_link[1] = x->pavl_link[0];
x->pavl_link[0] = y;
x->pavl_parent = y->pavl_parent;
y->pavl_parent = x;
if (y->pavl_link[1] != NULL)
  y->pavl_link[1]->pavl_parent = y;
q->pavl_link[dir] = x;
if (x->pavl_balance == 0)
  {
    x->pavl_balance = -1;
    y->pavl_balance = +1;
    break;
  }
else
  {
    x->pavl_balance = y->pavl_balance = 0;
    y = x;
  }
