select distinct c1.id from cinema c1, cinema c2
where abs(c1.id-c2.id) =1 and c1.free = 1 and c2.free =1
group by c1.id