anchor.diff:              if
                   LLD > LRD -> % 左の木の左が深いなら左の木を上げる
                       NR = map_rotate({map, KV, LR, R, 0}),
  -                    {map, KVL, LL, NR, max([LLD|[map_depth(NR)]]) + 1};
  +                    map_rotate({map, KVL, LL, NR, 0});
                   true -> % 左の木の右が深いなら左の木の右を上げる
                       {_, KVLR, LRL, LRR, _} = LR,
                       NR = map_rotate({map, KV, LRR, R, 0}),
                       NL = map_rotate({map, KVL, LL, LRL, 0}),
  -                    {map, KVLR, NL, NR, max([map_depth(NL)|[map_depth(NR)]]) + 1}
  +                    map_rotate({map, KVLR, NL, NR, 0})
               end;
           X when X < -1 -> % 右の木が深過ぎ
               {_, KVR, RL, RR, _} = R,
  
positive.code:     end;
  map_put(NK,NV, emptymap) -> {map, {NK, NV}, emptymap, emptymap, 1}.
  
  
  
  map_rotate({map, KV, L, R, _}) ->
      LD = map_depth(L),
      RD = map_depth(R),
  
negative.code: -import(lists,[reverse/1,max/1]).
  
  main(_) ->
      [_|W] = tokens(get_chars("",20000)," \n"),
      format("~s",[solve(W)]),
      halt().
  
  solve(W) ->
      M = mapping(W),
      palindrome(M, map_enumerator(M)).
  
  palindrome(M, W) -> palindrome(M, W, "", "", "").
  
  palindrome(_, noitem, L, C, R) -> concat(L, concat(C, R));
  palindrome(M, E, L, C, R) ->
      {H, V} = enumerator_get(E),
      T = enumerator_next(E),
      HR = reverse(H),
      case comp(H, HR) of
          gt -> palindrome(M, T, L, C, R);
  