local ffi = require 'ffi' local C, ct = ffi.C, ffi.typeof 'int16_t[1]' ffi.cdef 'int scanf(const char *, ...);' do local a,c1,c2,c3,c4 = {},ct(),ct(),ct(),ct() local n,l,r = io.stdin:read("*n"),io.stdin:read("*n"),io.stdin:read("*n") for i=1,n do C.scanf("%d%d%d%d",c1,c2,c3,c4) local xl,xr=c1[0],c3[0] a[i]={i,c4[0],function (x) return x>=xl and x<=xr end,false} end table.sort(a,function (a,b) return a[2]>b[2] end) for i=l,r do for j,v in ipairs(a) do if v[3](i) then a[j][4]=true break end end end table.sort(a,function (a,b) return a[1]