create table t_ykc ( 
c_l2i8lidek INTEGER ,
c_cuuul INTEGER ,
primary key(c_l2i8lidek),
unique(c_l2i8lidek)
);

create table t_ued0ue as 
select  
    ref_0.c_l2i8lidek as c0
  from 
    t_ykc as ref_0
  where ref_0.c_l2i8lidek <> ( 
    select  
          (select c_l2i8lidek from t_ykc order by c_l2i8lidek limit 1 offset 1)
             as c0
        from 
          t_ykc as ref_1
        where ref_0.c_cuuul > ref_0.c_l2i8lidek
      union
      select  
          ref_0.c_cuuul as c0
        from 
          t_ykc as ref_2
        where ref_0.c_cuuul <= ref_0.c_cuuul)
  group by ref_0.c_l2i8lidek;

WITH 
jennifer_1 AS (select distinct 
    case when ref_1.c_l2i8lidek not in (
          select  
              ref_5.c_l2i8lidek as c0
            from 
              t_ykc as ref_5
            ) then ref_1.c_l2i8lidek else ref_1.c_l2i8lidek end
       as c0
  from 
    t_ykc as ref_1
  where ((select c_l2i8lidek from t_ykc order by c_l2i8lidek limit 1 offset 5)
         in (
      select  
            ref_2.c_l2i8lidek as c0
          from 
            (t_ykc as ref_2
              cross join t_ykc as ref_3
              )
        )) 
  ), 

jennifer_2 AS (select distinct 
    ref_8.c_l2i8lidek as c0, 
    (select c_l2i8lidek from t_ykc order by c_l2i8lidek limit 1 offset 3)
       as c1, 
    ref_8.c_l2i8lidek as c2, 
    ref_8.c_l2i8lidek as c3, 
    ref_8.c_l2i8lidek as c4, 
    cast(coalesce(ref_8.c_l2i8lidek,
      ref_8.c_l2i8lidek) as SIGNED) as c5
  from 
    t_ykc as ref_8
  ), 

jennifer_3 AS (select  
    ((select c_l2i8lidek from t_ykc order by c_l2i8lidek limit 1 offset 1)
         * subq_0.c0) as c0, 
    (subq_0.c0 < subq_0.c0) as c1, 
    subq_0.c0 as c5, 
    subq_0.c0 as c6, 
    
      LAST_VALUE(
        cast(subq_0.c0 as SIGNED)) over (partition by subq_0.c0 order by subq_0.c0) as c10, 
    (subq_0.c0 + subq_0.c0) as c12
  from 
    (select  
          ref_9.c_l2i8lidek as c0, 
          ref_9.c_l2i8lidek as c1
        from 
          t_ykc as ref_9
    ) as subq_0
  )
select distinct 
    case when ref_10.c1 >= ( 
        select  
              ref_10.c5 >= ( 
                select distinct 
                      ref_10.c10 as c0
                    from 
                      jennifer_2 as ref_12
                    where ref_11.c0 < ( 
                        select  
                            ref_11.c0 as c0
                          from 
                            jennifer_1 as ref_16
                          where 1=1)
                    window a as ( partition by (select c0 from jennifer_1 order by c0 limit 1 offset 3)
                         order by ref_11.c0 desc)
                  ) as c0
            from 
              t_ued0ue as ref_11
            ) then ref_10.c6 else ref_10.c6 end
       as c0 
  from 
    jennifer_3 as ref_10
;

