:- use_module(library(clpfd)).
:- use_module('/afs/inria.fr/rocq/home/contraintes/jmartin/rules2cp/interpreter/prolog/r2cp.pl').
:- init_interpreter.


s1(_A_) :- 
	make_shape_box([1203,235,239], _A_).

s1_search(_A_) :- 
	make_shape_box_search([1203,235,239], _A_).

s2(_A_) :- 
	make_shape_box([224,224,222], _A_).

s2_search(_A_) :- 
	make_shape_box_search([224,224,222], _A_).

s3(_A_) :- 
	make_shape_box([224,224,148], _A_).

s3_search(_A_) :- 
	make_shape_box_search([224,224,148], _A_).

s4(_A_) :- 
	make_shape_box([224,224,111], _A_).

s4_search(_A_) :- 
	make_shape_box_search([224,224,111], _A_).

s5(_A_) :- 
	make_shape_box([224,224,74], _A_).

s5_search(_A_) :- 
	make_shape_box_search([224,224,74], _A_).

s6(_A_) :- 
	make_shape_box([155,224,222], _A_).

s6_search(_A_) :- 
	make_shape_box_search([155,224,222], _A_).

s7(_A_) :- 
	make_shape_box([112,224,148], _A_).

s7_search(_A_) :- 
	make_shape_box_search([112,224,148], _A_).

o1(_B_) :- 
	s1(_A_),
	make_object_shape(_A_, [0,0,0], _B_).

o1_search(_B_) :- 
	s1_search(_A_),
	make_object_shape_search(_A_, [0,0,0], _B_).

o2(_B_) :- 
	s4(_A_),
	rcp_var(from(o2,0,1), O2),
	rcp_var(from(o2,0,2), O2_2),
	rcp_var(from(o2,0,3), O2_3),
	make_object_shape(_A_, [O2,O2_2,O2_3], 413, _B_).

o2_search(_B_) :- 
	s4_search(_A_),
	rcp_var(from(o2,0,1), O2),
	rcp_var(from(o2,0,2), O2_2),
	rcp_var(from(o2,0,3), O2_3),
	make_object_shape_search(_A_, [O2,O2_2,O2_3], 413, _B_).

o3(_B_) :- 
	s5(_A_),
	rcp_var(from(o3,0,1), O3),
	rcp_var(from(o3,0,2), O3_2),
	rcp_var(from(o3,0,3), O3_3),
	make_object_shape(_A_, [O3,O3_2,O3_3], 463, _B_).

o3_search(_B_) :- 
	s5_search(_A_),
	rcp_var(from(o3,0,1), O3),
	rcp_var(from(o3,0,2), O3_2),
	rcp_var(from(o3,0,3), O3_3),
	make_object_shape_search(_A_, [O3,O3_2,O3_3], 463, _B_).

o4(_B_) :- 
	s5(_A_),
	rcp_var(from(o4,0,1), O4),
	rcp_var(from(o4,0,2), O4_2),
	rcp_var(from(o4,0,3), O4_3),
	make_object_shape(_A_, [O4,O4_2,O4_3], 842, _B_).

o4_search(_B_) :- 
	s5_search(_A_),
	rcp_var(from(o4,0,1), O4),
	rcp_var(from(o4,0,2), O4_2),
	rcp_var(from(o4,0,3), O4_3),
	make_object_shape_search(_A_, [O4,O4_2,O4_3], 842, _B_).

o5(_B_) :- 
	s3(_A_),
	rcp_var(from(o5,0,1), O5),
	rcp_var(from(o5,0,2), O5_2),
	rcp_var(from(o5,0,3), O5_3),
	make_object_shape(_A_, [O5,O5_2,O5_3], 422, _B_).

o5_search(_B_) :- 
	s3_search(_A_),
	rcp_var(from(o5,0,1), O5),
	rcp_var(from(o5,0,2), O5_2),
	rcp_var(from(o5,0,3), O5_3),
	make_object_shape_search(_A_, [O5,O5_2,O5_3], 422, _B_).

o6(_B_) :- 
	s4(_A_),
	rcp_var(from(o6,0,1), O6),
	rcp_var(from(o6,0,2), O6_2),
	rcp_var(from(o6,0,3), O6_3),
	make_object_shape(_A_, [O6,O6_2,O6_3], 266, _B_).

o6_search(_B_) :- 
	s4_search(_A_),
	rcp_var(from(o6,0,1), O6),
	rcp_var(from(o6,0,2), O6_2),
	rcp_var(from(o6,0,3), O6_3),
	make_object_shape_search(_A_, [O6,O6_2,O6_3], 266, _B_).

o7(_B_) :- 
	s4(_A_),
	rcp_var(from(o7,0,1), O7),
	rcp_var(from(o7,0,2), O7_2),
	rcp_var(from(o7,0,3), O7_3),
	make_object_shape(_A_, [O7,O7_2,O7_3], 321, _B_).

o7_search(_B_) :- 
	s4_search(_A_),
	rcp_var(from(o7,0,1), O7),
	rcp_var(from(o7,0,2), O7_2),
	rcp_var(from(o7,0,3), O7_3),
	make_object_shape_search(_A_, [O7,O7_2,O7_3], 321, _B_).

o8(_B_) :- 
	s2(_A_),
	rcp_var(from(o8,0,1), O8),
	rcp_var(from(o8,0,2), O8_2),
	rcp_var(from(o8,0,3), O8_3),
	make_object_shape(_A_, [O8,O8_2,O8_3], 670, _B_).

o8_search(_B_) :- 
	s2_search(_A_),
	rcp_var(from(o8,0,1), O8),
	rcp_var(from(o8,0,2), O8_2),
	rcp_var(from(o8,0,3), O8_3),
	make_object_shape_search(_A_, [O8,O8_2,O8_3], 670, _B_).

o9(_B_) :- 
	s6(_A_),
	rcp_var(from(o9,0,1), O9),
	rcp_var(from(o9,0,2), O9_2),
	rcp_var(from(o9,0,3), O9_3),
	make_object_shape(_A_, [O9,O9_2,O9_3], 440, _B_).

o9_search(_B_) :- 
	s6_search(_A_),
	rcp_var(from(o9,0,1), O9),
	rcp_var(from(o9,0,2), O9_2),
	rcp_var(from(o9,0,3), O9_3),
	make_object_shape_search(_A_, [O9,O9_2,O9_3], 440, _B_).

o10(_B_) :- 
	s7(_A_),
	rcp_var(from(o10,0,1), O10),
	rcp_var(from(o10,0,2), O10_2),
	rcp_var(from(o10,0,3), O10_3),
	make_object_shape(_A_, [O10,O10_2,O10_3], 325, _B_).

o10_search(_B_) :- 
	s7_search(_A_),
	rcp_var(from(o10,0,1), O10),
	rcp_var(from(o10,0,2), O10_2),
	rcp_var(from(o10,0,3), O10_3),
	make_object_shape_search(_A_, [O10,O10_2,O10_3], 325, _B_).

s11(_A_) :- 
	rcp_var(from(s11,0,1), S11),
	rcp_var(from(s11,0,2), S11_2),
	rcp_var(from(s11,0,3), S11_3),
	make_shape_box([S11,S11_2,S11_3], _A_).

s11_search(_A_) :- 
	rcp_var(from(s11,0,1), S11),
	rcp_var(from(s11,0,2), S11_2),
	rcp_var(from(s11,0,3), S11_3),
	make_shape_box_search([S11,S11_2,S11_3], _A_).

s41(_A_) :- 
	make_shape_box([224,111,224], _A_).

s41_search(_A_) :- 
	make_shape_box_search([224,111,224], _A_).

s51(_A_) :- 
	make_shape_box([224,74,224], _A_).

s51_search(_A_) :- 
	make_shape_box_search([224,74,224], _A_).

o11(_B_) :- 
	s11(_A_),
	make_object_shape(_A_, [0,0,0], _B_).

o11_search(_B_) :- 
	s11_search(_A_),
	make_object_shape_search(_A_, [0,0,0], _B_).

o41(_C_) :- 
	s4(_A_),
	s41(_B_),
	rcp_var(from(o41,0,1), O41),
	rcp_var(from(o41,0,2), O41_2),
	rcp_var(from(o41,0,3), O41_3),
	rcp_var(from(o41,0,4), O41_4),
	rcp_rec([shapes=[_A_,_B_],shape_index=O41,origin=[O41_2,O41_3,O41_4],weight=413], _C_).

o41_search(_C_) :- 
	s4_search(_A_),
	s41_search(_B_),
	rcp_var(from(o41,0,1), O41),
	rcp_var(from(o41,0,2), O41_2),
	rcp_var(from(o41,0,3), O41_3),
	rcp_var(from(o41,0,4), O41_4),
	rcp_rec([shapes=[_A_,_B_],shape_index=O41,origin=[O41_2,O41_3,O41_4],weight=413], _C_).

o51(_C_) :- 
	s5(_A_),
	s51(_B_),
	rcp_var(from(o51,0,1), O51),
	rcp_var(from(o51,0,2), O51_2),
	rcp_var(from(o51,0,3), O51_3),
	rcp_var(from(o51,0,4), O51_4),
	rcp_rec([shapes=[_A_,_B_],shape_index=O51,origin=[O51_2,O51_3,O51_4],weight=463], _C_).

o51_search(_C_) :- 
	s5_search(_A_),
	s51_search(_B_),
	rcp_var(from(o51,0,1), O51),
	rcp_var(from(o51,0,2), O51_2),
	rcp_var(from(o51,0,3), O51_3),
	rcp_var(from(o51,0,4), O51_4),
	rcp_rec([shapes=[_A_,_B_],shape_index=O51,origin=[O51_2,O51_3,O51_4],weight=463], _C_).

bin(_A_) :- 
	o1(_A_).

bin_search(_A_) :- 
	o1_search(_A_).

items(_J_) :- 
	o2(_A_),
	o3(_B_),
	o4(_C_),
	o5(_D_),
	o6(_E_),
	o7(_F_),
	o8(_G_),
	o9(_H_),
	o10(_I_),
	_J_=[_A_,_B_,_C_,_D_,_E_,_F_,_G_,_H_,_I_].

items_search(_J_) :- 
	o2_search(_A_),
	o3_search(_B_),
	o4_search(_C_),
	o5_search(_D_),
	o6_search(_E_),
	o7_search(_F_),
	o8_search(_G_),
	o9_search(_H_),
	o10_search(_I_),
	_J_=[_A_,_B_,_C_,_D_,_E_,_F_,_G_,_H_,_I_].

dimensions(_A_) :- 
	_A_=[1,2,3].

dimensions_search(_A_) :- 
	_A_=[1,2,3].

sum_foldr_1([], _, 0) :- 
	!.
sum_foldr_1([X_416|Tail], [L], _B_) :- 
	sum_foldr_1(Tail, [L], _A_),
	fd_aeq(X_416+_A_, _B_).

sum_foldr_1_search([], _, 0) :- 
	!.
sum_foldr_1_search([X_416|Tail], [L], _B_) :- 
	sum_foldr_1_search(Tail, [L], _A_),
	fd_aeq(X_416+_A_, _B_).

sum(L, _A_) :- 
	sum_foldr_1(L, [L], _A_).

sum_search(L, _A_) :- 
	sum_foldr_1_search(L, [L], _A_).

product_foldr_1([], _, 1) :- 
	!.
product_foldr_1([X_417|Tail], [L], _B_) :- 
	product_foldr_1(Tail, [L], _A_),
	fd_aeq(X_417*_A_, _B_).

product_foldr_1_search([], _, 1) :- 
	!.
product_foldr_1_search([X_417|Tail], [L], _B_) :- 
	product_foldr_1_search(Tail, [L], _A_),
	fd_aeq(X_417*_A_, _B_).

product(L, _A_) :- 
	product_foldr_1(L, [L], _A_).

product_search(L, _A_) :- 
	product_foldr_1_search(L, [L], _A_).

maximum_foldr_1([], _, _A_) :- 
	!.
maximum_foldr_1([X_418|Tail], [L], _B_) :- 
	maximum_foldr_1(Tail, [L], _A_),
	fd_aeq(max(X_418,_A_), _B_).

maximum_foldr_1_search([], _, _A_) :- 
	!.
maximum_foldr_1_search([X_418|Tail], [L], _B_) :- 
	maximum_foldr_1_search(Tail, [L], _A_),
	fd_aeq(max(X_418,_A_), _B_).

maximum(L, _A_) :- 
	maximum_foldr_1(L, [L], _A_).

maximum_search(L, _A_) :- 
	maximum_foldr_1_search(L, [L], _A_).

minimum_foldr_1([], _, _A_) :- 
	!.
minimum_foldr_1([X_419|Tail], [L], _B_) :- 
	minimum_foldr_1(Tail, [L], _A_),
	fd_aeq(min(X_419,_A_), _B_).

minimum_foldr_1_search([], _, _A_) :- 
	!.
minimum_foldr_1_search([X_419|Tail], [L], _B_) :- 
	minimum_foldr_1_search(Tail, [L], _A_),
	fd_aeq(min(X_419,_A_), _B_).

minimum(L, _A_) :- 
	minimum_foldr_1(L, [L], _A_).

minimum_search(L, _A_) :- 
	minimum_foldr_1_search(L, [L], _A_).

oversize(O1, O2, D, _O_) :- 
	origin(O1, D, _A_),
	origin(O2, D, _B_),
	fd_aeq(max(_A_,_B_), _C_),
	origin(O1, D, _D_),
	origin(O2, D, _E_),
	fd_aeq(min(_D_,_E_), _F_),
	fd_aeq(_C_-_F_, _G_),
	end(O1, D, _H_),
	end(O2, D, _I_),
	fd_aeq(max(_H_,_I_), _J_),
	end(O1, D, _K_),
	end(O2, D, _L_),
	fd_aeq(min(_K_,_L_), _M_),
	fd_aeq(_J_-_M_, _N_),
	fd_aeq(max(_G_,_N_), _O_).

oversize_search(O1, O2, D, _O_) :- 
	origin_search(O1, D, _A_),
	origin_search(O2, D, _B_),
	fd_aeq(max(_A_,_B_), _C_),
	origin_search(O1, D, _D_),
	origin_search(O2, D, _E_),
	fd_aeq(min(_D_,_E_), _F_),
	fd_aeq(_C_-_F_, _G_),
	end_search(O1, D, _H_),
	end_search(O2, D, _I_),
	fd_aeq(max(_H_,_I_), _J_),
	end_search(O1, D, _K_),
	end_search(O2, D, _L_),
	fd_aeq(min(_K_,_L_), _M_),
	fd_aeq(_J_-_M_, _N_),
	fd_aeq(max(_G_,_N_), _O_).

make_box(L, _A_) :- 
	rcp_rec([size=L], _A_).

make_box_search(L, _A_) :- 
	rcp_rec([size=L], _A_).

box_volume(B, _B_) :- 
	rcp_att(size, B, _A_),
	product(_A_, _B_).

box_volume_search(B, _B_) :- 
	rcp_att(size, B, _A_),
	product_search(_A_, _B_).

make_sbox(B, O, _A_) :- 
	rcp_rec([box=B,offset=O], _A_).

make_sbox_search(B, O, _A_) :- 
	rcp_rec([box=B,offset=O], _A_).

sbox_size(SB, D, _C_) :- 
	rcp_att(box, SB, _A_),
	rcp_att(size, _A_, _B_),
	nth1(D, _B_, _C_).

sbox_size_search(SB, D, _C_) :- 
	rcp_att(box, SB, _A_),
	rcp_att(size, _A_, _B_),
	nth1(D, _B_, _C_).

sbox_offset(SB, D, _B_) :- 
	rcp_att(offset, SB, _A_),
	nth1(D, _A_, _B_).

sbox_offset_search(SB, D, _B_) :- 
	rcp_att(offset, SB, _A_),
	nth1(D, _A_, _B_).

sbox_end(SB, D, _C_) :- 
	sbox_offset(SB, D, _A_),
	sbox_size(SB, D, _B_),
	fd_aeq(_A_+_B_, _C_).

sbox_end_search(SB, D, _C_) :- 
	sbox_offset_search(SB, D, _A_),
	sbox_size_search(SB, D, _B_),
	fd_aeq(_A_+_B_, _C_).

make_shape(SBs, _A_) :- 
	rcp_rec([sboxes=SBs], _A_).

make_shape_search(SBs, _A_) :- 
	rcp_rec([sboxes=SBs], _A_).

make_shape_box_foldr_1([], _, []) :- 
	!.
make_shape_box_foldr_1([_free_var_420|Tail], [L], [0|_A_]) :- 
	make_shape_box_foldr_1(Tail, [L], _A_).

make_shape_box_foldr_1_search([], _, []) :- 
	!.
make_shape_box_foldr_1_search([_free_var_420|Tail], [L], [0|_A_]) :- 
	make_shape_box_foldr_1_search(Tail, [L], _A_).

make_shape_box(L, _D_) :- 
	make_box(L, _A_),
	make_shape_box_foldr_1(L, [L], _B_),
	make_sbox(_A_, _B_, _C_),
	make_shape([_C_], _D_).

make_shape_box_search(L, _D_) :- 
	make_box_search(L, _A_),
	make_shape_box_foldr_1_search(L, [L], _B_),
	make_sbox_search(_A_, _B_, _C_),
	make_shape_search([_C_], _D_).

shape_volume_foldr_1([], _, []) :- 
	!.
shape_volume_foldr_1([SB_421|Tail], [S], [_B_|_C_]) :- 
	shape_volume_foldr_1(Tail, [S], _C_),
	rcp_att(box, SB_421, _A_),
	box_volume(_A_, _B_).

shape_volume_foldr_1_search([], _, []) :- 
	!.
shape_volume_foldr_1_search([SB_421|Tail], [S], [_B_|_C_]) :- 
	shape_volume_foldr_1_search(Tail, [S], _C_),
	rcp_att(box, SB_421, _A_),
	box_volume_search(_A_, _B_).

shape_volume(S, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_volume_foldr_1(_A_, [S], _B_),
	sum(_B_, _C_).

shape_volume_search(S, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_volume_foldr_1_search(_A_, [S], _B_),
	sum_search(_B_, _C_).

shape_origin_foldr_1([], _, []) :- 
	!.
shape_origin_foldr_1([SB_422|Tail], [D,S], [_A_|_B_]) :- 
	shape_origin_foldr_1(Tail, [D,S], _B_),
	sbox_offset(SB_422, D, _A_).

shape_origin_foldr_1_search([], _, []) :- 
	!.
shape_origin_foldr_1_search([SB_422|Tail], [D,S], [_A_|_B_]) :- 
	shape_origin_foldr_1_search(Tail, [D,S], _B_),
	sbox_offset_search(SB_422, D, _A_).

shape_origin(S, D, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_origin_foldr_1(_A_, [D,S], _B_),
	minimum(_B_, _C_).

shape_origin_search(S, D, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_origin_foldr_1_search(_A_, [D,S], _B_),
	minimum_search(_B_, _C_).

shape_end_foldr_1([], _, []) :- 
	!.
shape_end_foldr_1([SB_423|Tail], [D,S], [_A_|_B_]) :- 
	shape_end_foldr_1(Tail, [D,S], _B_),
	sbox_end(SB_423, D, _A_).

shape_end_foldr_1_search([], _, []) :- 
	!.
shape_end_foldr_1_search([SB_423|Tail], [D,S], [_A_|_B_]) :- 
	shape_end_foldr_1_search(Tail, [D,S], _B_),
	sbox_end_search(SB_423, D, _A_).

shape_end(S, D, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_end_foldr_1(_A_, [D,S], _B_),
	maximum(_B_, _C_).

shape_end_search(S, D, _C_) :- 
	rcp_att(sboxes, S, _A_),
	shape_end_foldr_1_search(_A_, [D,S], _B_),
	maximum_search(_B_, _C_).

shape_size(S, D, _C_) :- 
	shape_end(S, D, _A_),
	shape_origin(S, D, _B_),
	fd_aeq(_A_-_B_, _C_).

shape_size_search(S, D, _C_) :- 
	shape_end_search(S, D, _A_),
	shape_origin_search(S, D, _B_),
	fd_aeq(_A_-_B_, _C_).

make_object(SL, OL, _A_) :- 
	rcp_var(from(make_object(SL,OL),0,0), Make_object_SL_OL),
	rcp_rec([shapes=SL,shape_index=Make_object_SL_OL,origin=OL], _A_).

make_object_search(SL, OL, _A_) :- 
	rcp_var(from(make_object(SL,OL),0,0), Make_object_SL_OL),
	rcp_rec([shapes=SL,shape_index=Make_object_SL_OL,origin=OL], _A_).

make_object(SL, OL, S, W, _A_) :- 
	rcp_rec([shapes=SL,shape_index=S,origin=OL,weight=W], _A_).

make_object_search(SL, OL, S, W, _A_) :- 
	rcp_rec([shapes=SL,shape_index=S,origin=OL,weight=W], _A_).

make_object_shape(S, L, _A_) :- 
	rcp_rec([shapes=[S],shape_index=1,origin=L], _A_).

make_object_shape_search(S, L, _A_) :- 
	rcp_rec([shapes=[S],shape_index=1,origin=L], _A_).

make_object_shape(S, L, W, _A_) :- 
	rcp_rec([shapes=[S],shape_index=1,origin=L,weight=W], _A_).

make_object_shape_search(S, L, W, _A_) :- 
	rcp_rec([shapes=[S],shape_index=1,origin=L,weight=W], _A_).

origin(O, D, _B_) :- 
	rcp_att(origin, O, _A_),
	nth1(D, _A_, _B_).

origin_search(O, D, _B_) :- 
	rcp_att(origin, O, _A_),
	nth1(D, _A_, _B_).

x(O, _A_) :- 
	origin(O, 1, _A_).

x_search(O, _A_) :- 
	origin_search(O, 1, _A_).

y(O, _A_) :- 
	origin(O, 2, _A_).

y_search(O, _A_) :- 
	origin_search(O, 2, _A_).

z(O, _A_) :- 
	origin(O, 3, _A_).

z_search(O, _A_) :- 
	origin_search(O, 3, _A_).

end_foldr_1([], _, []) :- 
	!.
end_foldr_1([S_424|Tail], [D,O], [_F_|_G_]) :- 
	end_foldr_1(Tail, [D,O], _G_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_424),
	fd_eq(_A_, _C_, _D_),
	shape_end(S_424, D, _E_),
	fd_aeq(_D_*_E_, _F_).

end_foldr_1_search([], _, []) :- 
	!.
end_foldr_1_search([S_424|Tail], [D,O], [_E_|_F_]) :- 
	end_foldr_1_search(Tail, [D,O], _F_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_424),
	shape_end_search(S_424, D, _D_),
	fd_aeq(fd_eq(_A_,_C_)*_D_, _E_).

end(O, D, _E_) :- 
	origin(O, D, _A_),
	rcp_att(shapes, O, _B_),
	end_foldr_1(_B_, [D,O], _C_),
	sum(_C_, _D_),
	fd_aeq(_A_+_D_, _E_).

end_search(O, D, _E_) :- 
	origin_search(O, D, _A_),
	rcp_att(shapes, O, _B_),
	end_foldr_1_search(_B_, [D,O], _C_),
	sum_search(_C_, _D_),
	fd_aeq(_A_+_D_, _E_).

size_foldr_1([], _, []) :- 
	!.
size_foldr_1([S_425|Tail], [D,O], [_F_|_G_]) :- 
	size_foldr_1(Tail, [D,O], _G_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_425),
	fd_eq(_A_, _C_, _D_),
	shape_size(S_425, D, _E_),
	fd_aeq(_D_*_E_, _F_).

size_foldr_1_search([], _, []) :- 
	!.
size_foldr_1_search([S_425|Tail], [D,O], [_E_|_F_]) :- 
	size_foldr_1_search(Tail, [D,O], _F_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_425),
	shape_size_search(S_425, D, _D_),
	fd_aeq(fd_eq(_A_,_C_)*_D_, _E_).

size(O, D, _C_) :- 
	rcp_att(shapes, O, _A_),
	size_foldr_1(_A_, [D,O], _B_),
	sum(_B_, _C_).

size_search(O, D, _C_) :- 
	rcp_att(shapes, O, _A_),
	size_foldr_1_search(_A_, [D,O], _B_),
	sum_search(_B_, _C_).

volume_foldr_1([], _, []) :- 
	!.
volume_foldr_1([S_426|Tail], [O], [_F_|_G_]) :- 
	volume_foldr_1(Tail, [O], _G_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_426),
	fd_eq(_A_, _C_, _D_),
	shape_volume(S_426, _E_),
	fd_aeq(_D_*_E_, _F_).

volume_foldr_1_search([], _, []) :- 
	!.
volume_foldr_1_search([S_426|Tail], [O], [_E_|_F_]) :- 
	volume_foldr_1_search(Tail, [O], _F_),
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	nth1(_C_, _B_, S_426),
	shape_volume_search(S_426, _D_),
	fd_aeq(fd_eq(_A_,_C_)*_D_, _E_).

volume(O, _C_) :- 
	rcp_att(shapes, O, _A_),
	volume_foldr_1(_A_, [O], _B_),
	sum(_B_, _C_).

volume_search(O, _C_) :- 
	rcp_att(shapes, O, _A_),
	volume_foldr_1_search(_A_, [O], _B_),
	sum_search(_B_, _C_).

distance(O1, O2, D, _H_) :- 
	origin(O1, D, _A_),
	origin(O2, D, _B_),
	fd_aeq(max(_A_,_B_), _C_),
	end(O1, D, _D_),
	end(O2, D, _E_),
	fd_aeq(min(_D_,_E_), _F_),
	fd_aeq(_C_-_F_, _G_),
	fd_aeq(max(0,_G_), _H_).

distance_search(O1, O2, D, _H_) :- 
	origin_search(O1, D, _A_),
	origin_search(O2, D, _B_),
	fd_aeq(max(_A_,_B_), _C_),
	end_search(O1, D, _D_),
	end_search(O2, D, _E_),
	fd_aeq(min(_D_,_E_), _F_),
	fd_aeq(_C_-_F_, _G_),
	fd_aeq(max(0,_G_), _H_).

w(O, _A_) :- 
	size(O, 1, _A_).

w_search(O, _A_) :- 
	size_search(O, 1, _A_).

h(O, _A_) :- 
	size(O, 2, _A_).

h_search(O, _A_) :- 
	size_search(O, 2, _A_).

l(O, _A_) :- 
	size(O, 3, _A_).

l_search(O, _A_) :- 
	size_search(O, 3, _A_).

geost_constraint_foldr_2([], _, []) :- 
	!.
geost_constraint_foldr_2([S_429|Tail], [Dims,I_427,Items], [_A_|_B_]) :- 
	geost_constraint_foldr_2(Tail, [Dims,I_427,Items], _B_),
	rcp_att(uid, S_429, _A_).

geost_constraint_foldr_2_search([], _, []) :- 
	!.
geost_constraint_foldr_2_search([S_429|Tail], [Dims,I_427,Items], [_A_|_B_]) :- 
	geost_constraint_foldr_2_search(Tail, [Dims,I_427,Items], _B_),
	rcp_att(uid, S_429, _A_).

geost_constraint_foldr_1([], _, []) :- 
	!.
geost_constraint_foldr_1([I_427|Tail], [Dims,Items], [[_A_,_B_,_D_,_E_]|_F_]) :- 
	geost_constraint_foldr_1(Tail, [Dims,Items], _F_),
	rcp_att(uid, I_427, _A_),
	rcp_att(shape_index, I_427, _B_),
	rcp_att(shapes, I_427, _C_),
	geost_constraint_foldr_2(_C_, [Dims,I_427,Items], _D_),
	rcp_att(origin, I_427, _E_).

geost_constraint_foldr_1_search([], _, []) :- 
	!.
geost_constraint_foldr_1_search([I_427|Tail], [Dims,Items], [[_A_,_B_,_D_,_E_]|_F_]) :- 
	geost_constraint_foldr_1_search(Tail, [Dims,Items], _F_),
	rcp_att(uid, I_427, _A_),
	rcp_att(shape_index, I_427, _B_),
	rcp_att(shapes, I_427, _C_),
	geost_constraint_foldr_2_search(_C_, [Dims,I_427,Items], _D_),
	rcp_att(origin, I_427, _E_).

geost_constraint_foldr_5([], _, []) :- 
	!.
geost_constraint_foldr_5([SB_435|Tail], [Dims,I_430,Items,S_433], [[_A_,_B_,_D_]|_E_]) :- 
	geost_constraint_foldr_5(Tail, [Dims,I_430,Items,S_433], _E_),
	rcp_att(uid, S_433, _A_),
	rcp_att(offset, SB_435, _B_),
	rcp_att(box, SB_435, _C_),
	rcp_att(size, _C_, _D_).

geost_constraint_foldr_5_search([], _, []) :- 
	!.
geost_constraint_foldr_5_search([SB_435|Tail], [Dims,I_430,Items,S_433], [[_A_,_B_,_D_]|_E_]) :- 
	geost_constraint_foldr_5_search(Tail, [Dims,I_430,Items,S_433], _E_),
	rcp_att(uid, S_433, _A_),
	rcp_att(offset, SB_435, _B_),
	rcp_att(box, SB_435, _C_),
	rcp_att(size, _C_, _D_).

geost_constraint_foldr_4([], _, []) :- 
	!.
geost_constraint_foldr_4([S_433|Tail], [Dims,I_430,Items], [_B_|_C_]) :- 
	geost_constraint_foldr_4(Tail, [Dims,I_430,Items], _C_),
	rcp_att(sboxes, S_433, _A_),
	geost_constraint_foldr_5(_A_, [Dims,I_430,Items,S_433], _B_).

geost_constraint_foldr_4_search([], _, []) :- 
	!.
geost_constraint_foldr_4_search([S_433|Tail], [Dims,I_430,Items], [_B_|_C_]) :- 
	geost_constraint_foldr_4_search(Tail, [Dims,I_430,Items], _C_),
	rcp_att(sboxes, S_433, _A_),
	geost_constraint_foldr_5_search(_A_, [Dims,I_430,Items,S_433], _B_).

geost_constraint_foldr_3([], _, []) :- 
	!.
geost_constraint_foldr_3([I_430|Tail], [Dims,Items], [_B_|_C_]) :- 
	geost_constraint_foldr_3(Tail, [Dims,Items], _C_),
	rcp_att(shapes, I_430, _A_),
	geost_constraint_foldr_4(_A_, [Dims,I_430,Items], _B_).

geost_constraint_foldr_3_search([], _, []) :- 
	!.
geost_constraint_foldr_3_search([I_430|Tail], [Dims,Items], [_B_|_C_]) :- 
	geost_constraint_foldr_3_search(Tail, [Dims,Items], _C_),
	rcp_att(shapes, I_430, _A_),
	geost_constraint_foldr_4_search(_A_, [Dims,I_430,Items], _B_).

non_overlapping(Items, Dims, _D_) :- 
	geost_constraint_foldr_1(Items, [Dims,Items], _A_),
	geost_constraint_foldr_3(Items, [Dims,Items], _B_),
	length(Dims, _C_),
	geost_constraint(_A_, _B_, _C_, _D_).

non_overlapping_search(Items, Dims, _D_) :- 
	geost_constraint_foldr_1_search(Items, [Dims,Items], _A_),
	geost_constraint_foldr_3_search(Items, [Dims,Items], _B_),
	length(Dims, _C_),
	geost_constraint(_A_, _B_, _C_, _D_).

precedes(A, B, D, _C_) :- 
	end(A, D, _A_),
	origin(B, D, _B_),
	fd_lt(_A_, _B_, _C_).

precedes_search(A, B, D, _C_) :- 
	end_search(A, D, _A_),
	origin_search(B, D, _B_),
	fd_lt(_A_, _B_),
	fd_aeq(_C_, 1).

meets(A, B, D, _C_) :- 
	end(A, D, _A_),
	origin(B, D, _B_),
	fd_eq(_A_, _B_, _C_).

meets_search(A, B, D, _C_) :- 
	end_search(A, D, _A_),
	origin_search(B, D, _B_),
	fd_eq(_A_, _B_),
	fd_aeq(_C_, 1).

overlaps(A, B, D, _K_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_lt(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_),
	origin(B, D, _H_),
	end(A, D, _I_),
	fd_lt(_H_, _I_, _J_),
	fd_and(_G_, _J_, _K_).

overlaps_search(A, B, D, _G_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	origin_search(B, D, _E_),
	end_search(A, D, _F_),
	fd_lt(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_lt(_E_, _F_),
	fd_aeq(_G_, 1).

contains(A, B, D, _G_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_lt(_A_, _B_, _C_),
	end(B, D, _D_),
	end(A, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

contains_search(A, B, D, _E_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(B, D, _C_),
	end_search(A, D, _D_),
	fd_lt(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_aeq(_E_, 1).

starts(A, B, D, _G_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_eq(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

starts_search(A, B, D, _E_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	fd_eq(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_aeq(_E_, 1).

finishes(A, B, D, _G_) :- 
	origin(B, D, _A_),
	origin(A, D, _B_),
	fd_lt(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_eq(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

finishes_search(A, B, D, _E_) :- 
	origin_search(B, D, _A_),
	origin_search(A, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	fd_lt(_A_, _B_),
	fd_eq(_C_, _D_),
	fd_aeq(_E_, 1).

equals(A, B, D, _G_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_eq(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_eq(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

equals_search(A, B, D, _E_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	fd_eq(_A_, _B_),
	fd_eq(_C_, _D_),
	fd_aeq(_E_, 1).

started_by(A, B, D, _G_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_eq(_A_, _B_, _C_),
	end(B, D, _D_),
	end(A, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

started_by_search(A, B, D, _E_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(B, D, _C_),
	end_search(A, D, _D_),
	fd_eq(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_aeq(_E_, 1).

finished_by(A, B, D, _G_) :- 
	origin(B, D, _A_),
	origin(A, D, _B_),
	fd_gt(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_eq(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

finished_by_search(A, B, D, _E_) :- 
	origin_search(B, D, _A_),
	origin_search(A, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	fd_gt(_A_, _B_),
	fd_eq(_C_, _D_),
	fd_aeq(_E_, 1).

during(A, B, D, _G_) :- 
	origin(B, D, _A_),
	origin(A, D, _B_),
	fd_lt(_A_, _B_, _C_),
	end(A, D, _D_),
	end(B, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

during_search(A, B, D, _E_) :- 
	origin_search(B, D, _A_),
	origin_search(A, D, _B_),
	end_search(A, D, _C_),
	end_search(B, D, _D_),
	fd_lt(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_aeq(_E_, 1).

overlapped_by(A, B, D, _K_) :- 
	origin(B, D, _A_),
	origin(A, D, _B_),
	fd_lt(_A_, _B_, _C_),
	origin(A, D, _D_),
	end(B, D, _E_),
	fd_lt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_),
	end(A, D, _H_),
	end(B, D, _I_),
	fd_gt(_H_, _I_, _J_),
	fd_and(_G_, _J_, _K_).

overlapped_by_search(A, B, D, _G_) :- 
	origin_search(B, D, _A_),
	origin_search(A, D, _B_),
	origin_search(A, D, _C_),
	end_search(B, D, _D_),
	end_search(A, D, _E_),
	end_search(B, D, _F_),
	fd_lt(_A_, _B_),
	fd_lt(_C_, _D_),
	fd_gt(_E_, _F_),
	fd_aeq(_G_, 1).

met_by(A, B, D, _C_) :- 
	end(B, D, _A_),
	origin(A, D, _B_),
	fd_eq(_A_, _B_, _C_).

met_by_search(A, B, D, _C_) :- 
	end_search(B, D, _A_),
	origin_search(A, D, _B_),
	fd_eq(_A_, _B_),
	fd_aeq(_C_, 1).

preceded_by(A, B, D, _C_) :- 
	end(B, D, _A_),
	origin(A, D, _B_),
	fd_lt(_A_, _B_, _C_).

preceded_by_search(A, B, D, _C_) :- 
	end_search(B, D, _A_),
	origin_search(A, D, _B_),
	fd_lt(_A_, _B_),
	fd_aeq(_C_, 1).

contains_touch(A, B, D, _G_) :- 
	origin(A, D, _A_),
	origin(B, D, _B_),
	fd_leq(_A_, _B_, _C_),
	end(B, D, _D_),
	end(A, D, _E_),
	fd_leq(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

contains_touch_search(A, B, D, _E_) :- 
	origin_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(B, D, _C_),
	end_search(A, D, _D_),
	fd_leq(_A_, _B_),
	fd_leq(_C_, _D_),
	fd_aeq(_E_, 1).

overlaps_sym(A, B, D, _G_) :- 
	end(A, D, _A_),
	origin(B, D, _B_),
	fd_gt(_A_, _B_, _C_),
	end(B, D, _D_),
	origin(A, D, _E_),
	fd_gt(_D_, _E_, _F_),
	fd_and(_C_, _F_, _G_).

overlaps_sym_search(A, B, D, _E_) :- 
	end_search(A, D, _A_),
	origin_search(B, D, _B_),
	end_search(B, D, _C_),
	origin_search(A, D, _D_),
	fd_gt(_A_, _B_),
	fd_gt(_C_, _D_),
	fd_aeq(_E_, 1).

disjoint_foldl_1([], I_or, _, I_or) :- 
	!.
disjoint_foldl_1([D_436|Tail], I_or, [Ds,O1,O2], _D_) :- 
	precedes(O1, O2, D_436, _A_),
	preceded_by(O1, O2, D_436, _B_),
	fd_or(_A_, _B_, _C_),
	fd_or(I_or, _C_, _E_),
	disjoint_foldl_1(Tail, _E_, [Ds,O1,O2], _D_).

disjoint_foldl_1_search([], I_or, _, I_or) :- 
	!.
disjoint_foldl_1_search([D_436|Tail], I_or, [Ds,O1,O2], _C_) :- 
	(
	rcp_fol_call(I_or)
	;
	(
	precedes_search(O1, O2, D_436, _A_),
	rcp_fol_call(_A_)
	;
	preceded_by_search(O1, O2, D_436, _B_),
	rcp_fol_call(_B_)
	)
	),
	disjoint_foldl_1_search(Tail, _D_, [Ds,O1,O2], _C_).

disjoint(O1, O2, Ds, _A_) :- 
	disjoint_foldl_1(Ds, 0, [Ds,O1,O2], _A_).

disjoint_search(O1, O2, Ds, _A_) :- 
	disjoint_foldl_1_search(Ds, 0, [Ds,O1,O2], _A_).

meet_foldl_1([], I_and, _, I_and) :- 
	!.
meet_foldl_1([D_437|Tail], I_and, [Ds,O1,O2], _F_) :- 
	precedes(O1, O2, D_437, _A_),
	fd_not(_A_, _B_),
	preceded_by(O1, O2, D_437, _C_),
	fd_not(_C_, _D_),
	fd_and(_B_, _D_, _E_),
	fd_and(I_and, _E_, _G_),
	meet_foldl_1(Tail, _G_, [Ds,O1,O2], _F_).

meet_foldl_1_search([], I_and, _, I_and) :- 
	!.
meet_foldl_1_search([D_437|Tail], I_and, [Ds,O1,O2], _E_) :- 
	rcp_fol_call(I_and),
	precedes_search(O1, O2, D_437, _A_),
	fd_not(_A_, _B_),
	rcp_fol_call(_B_),
	preceded_by_search(O1, O2, D_437, _C_),
	fd_not(_C_, _D_),
	rcp_fol_call(_D_),
	meet_foldl_1_search(Tail, _F_, [Ds,O1,O2], _E_).

meet_foldl_2([], I_or, _, I_or) :- 
	!.
meet_foldl_2([D_438|Tail], I_or, [Ds,O1,O2], _D_) :- 
	meets(O1, O2, D_438, _A_),
	met_by(O1, O2, D_438, _B_),
	fd_or(_A_, _B_, _C_),
	fd_or(I_or, _C_, _E_),
	meet_foldl_2(Tail, _E_, [Ds,O1,O2], _D_).

meet_foldl_2_search([], I_or, _, I_or) :- 
	!.
meet_foldl_2_search([D_438|Tail], I_or, [Ds,O1,O2], _C_) :- 
	(
	rcp_fol_call(I_or)
	;
	(
	meets_search(O1, O2, D_438, _A_),
	rcp_fol_call(_A_)
	;
	met_by_search(O1, O2, D_438, _B_),
	rcp_fol_call(_B_)
	)
	),
	meet_foldl_2_search(Tail, _D_, [Ds,O1,O2], _C_).

meet(O1, O2, Ds, _C_) :- 
	meet_foldl_1(Ds, 1, [Ds,O1,O2], _A_),
	meet_foldl_2(Ds, 0, [Ds,O1,O2], _B_),
	fd_and(_A_, _B_, _C_).

meet_search(O1, O2, Ds, _C_) :- 
	meet_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_),
	rcp_fol_call(_A_),
	meet_foldl_2_search(Ds, 0, [Ds,O1,O2], _B_),
	rcp_fol_call(_B_),
	fd_aeq(_C_, 1).

equal_foldl_1([], I_and, _, I_and) :- 
	!.
equal_foldl_1([D_439|Tail], I_and, [Ds,O1,O2], _B_) :- 
	equals(O1, O2, D_439, _A_),
	fd_and(I_and, _A_, _C_),
	equal_foldl_1(Tail, _C_, [Ds,O1,O2], _B_).

equal_foldl_1_search([], I_and, _, I_and) :- 
	!.
equal_foldl_1_search([D_439|Tail], I_and, [Ds,O1,O2], _B_) :- 
	equals_search(O1, O2, D_439, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	equal_foldl_1_search(Tail, _C_, [Ds,O1,O2], _B_).

equal(O1, O2, Ds, _A_) :- 
	equal_foldl_1(Ds, 1, [Ds,O1,O2], _A_).

equal_search(O1, O2, Ds, _A_) :- 
	equal_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_).

covers_foldl_1([], I_and, _, I_and) :- 
	!.
covers_foldl_1([D_440|Tail], I_and, [Ds,O1,O2], _F_) :- 
	started_by(O1, O2, D_440, _A_),
	contains(O1, O2, D_440, _B_),
	fd_or(_A_, _B_, _C_),
	finished_by(O1, O2, D_440, _D_),
	fd_or(_C_, _D_, _E_),
	fd_and(I_and, _E_, _G_),
	covers_foldl_1(Tail, _G_, [Ds,O1,O2], _F_).

covers_foldl_1_search([], I_and, _, I_and) :- 
	!.
covers_foldl_1_search([D_440|Tail], I_and, [Ds,O1,O2], _D_) :- 
	rcp_fol_call(I_and),
	(
	(
	started_by_search(O1, O2, D_440, _A_),
	rcp_fol_call(_A_)
	;
	contains_search(O1, O2, D_440, _B_),
	rcp_fol_call(_B_)
	)
	;
	finished_by_search(O1, O2, D_440, _C_),
	rcp_fol_call(_C_)
	),
	covers_foldl_1_search(Tail, _E_, [Ds,O1,O2], _D_).

covers_foldl_2([], I_or, _, I_or) :- 
	!.
covers_foldl_2([D_441|Tail], I_or, [Ds,O1,O2], _C_) :- 
	contains(O1, O2, D_441, _A_),
	fd_not(_A_, _B_),
	fd_or(I_or, _B_, _D_),
	covers_foldl_2(Tail, _D_, [Ds,O1,O2], _C_).

covers_foldl_2_search([], I_or, _, I_or) :- 
	!.
covers_foldl_2_search([D_441|Tail], I_or, [Ds,O1,O2], _C_) :- 
	contains_search(O1, O2, D_441, _A_),
	fd_not(_A_, _B_),
	(
	rcp_fol_call(I_or)
	;
	rcp_fol_call(_B_)
	),
	covers_foldl_2_search(Tail, _D_, [Ds,O1,O2], _C_).

covers(O1, O2, Ds, _C_) :- 
	covers_foldl_1(Ds, 1, [Ds,O1,O2], _A_),
	covers_foldl_2(Ds, 0, [Ds,O1,O2], _B_),
	fd_and(_A_, _B_, _C_).

covers_search(O1, O2, Ds, _C_) :- 
	covers_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_),
	rcp_fol_call(_A_),
	covers_foldl_2_search(Ds, 0, [Ds,O1,O2], _B_),
	rcp_fol_call(_B_),
	fd_aeq(_C_, 1).

covered_by_foldl_1([], I_and, _, I_and) :- 
	!.
covered_by_foldl_1([D_442|Tail], I_and, [Ds,O1,O2], _F_) :- 
	starts(O1, O2, D_442, _A_),
	during(O1, O2, D_442, _B_),
	fd_or(_A_, _B_, _C_),
	finishes(O1, O2, D_442, _D_),
	fd_or(_C_, _D_, _E_),
	fd_and(I_and, _E_, _G_),
	covered_by_foldl_1(Tail, _G_, [Ds,O1,O2], _F_).

covered_by_foldl_1_search([], I_and, _, I_and) :- 
	!.
covered_by_foldl_1_search([D_442|Tail], I_and, [Ds,O1,O2], _D_) :- 
	rcp_fol_call(I_and),
	(
	(
	starts_search(O1, O2, D_442, _A_),
	rcp_fol_call(_A_)
	;
	during_search(O1, O2, D_442, _B_),
	rcp_fol_call(_B_)
	)
	;
	finishes_search(O1, O2, D_442, _C_),
	rcp_fol_call(_C_)
	),
	covered_by_foldl_1_search(Tail, _E_, [Ds,O1,O2], _D_).

covered_by_foldl_2([], I_or, _, I_or) :- 
	!.
covered_by_foldl_2([D_443|Tail], I_or, [Ds,O1,O2], _C_) :- 
	during(O1, O2, D_443, _A_),
	fd_not(_A_, _B_),
	fd_or(I_or, _B_, _D_),
	covered_by_foldl_2(Tail, _D_, [Ds,O1,O2], _C_).

covered_by_foldl_2_search([], I_or, _, I_or) :- 
	!.
covered_by_foldl_2_search([D_443|Tail], I_or, [Ds,O1,O2], _C_) :- 
	during_search(O1, O2, D_443, _A_),
	fd_not(_A_, _B_),
	(
	rcp_fol_call(I_or)
	;
	rcp_fol_call(_B_)
	),
	covered_by_foldl_2_search(Tail, _D_, [Ds,O1,O2], _C_).

covered_by(O1, O2, Ds, _C_) :- 
	covered_by_foldl_1(Ds, 1, [Ds,O1,O2], _A_),
	covered_by_foldl_2(Ds, 0, [Ds,O1,O2], _B_),
	fd_and(_A_, _B_, _C_).

covered_by_search(O1, O2, Ds, _C_) :- 
	covered_by_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_),
	rcp_fol_call(_A_),
	covered_by_foldl_2_search(Ds, 0, [Ds,O1,O2], _B_),
	rcp_fol_call(_B_),
	fd_aeq(_C_, 1).

contains_rcc_foldl_1([], I_and, _, I_and) :- 
	!.
contains_rcc_foldl_1([D_444|Tail], I_and, [Ds,O1,O2], _B_) :- 
	contains(O1, O2, D_444, _A_),
	fd_and(I_and, _A_, _C_),
	contains_rcc_foldl_1(Tail, _C_, [Ds,O1,O2], _B_).

contains_rcc_foldl_1_search([], I_and, _, I_and) :- 
	!.
contains_rcc_foldl_1_search([D_444|Tail], I_and, [Ds,O1,O2], _B_) :- 
	contains_search(O1, O2, D_444, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	contains_rcc_foldl_1_search(Tail, _C_, [Ds,O1,O2], _B_).

contains_rcc(O1, O2, Ds, _A_) :- 
	contains_rcc_foldl_1(Ds, 1, [Ds,O1,O2], _A_).

contains_rcc_search(O1, O2, Ds, _A_) :- 
	contains_rcc_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_).

inside_foldl_1([], I_and, _, I_and) :- 
	!.
inside_foldl_1([D_445|Tail], I_and, [Ds,O1,O2], _B_) :- 
	during(O1, O2, D_445, _A_),
	fd_and(I_and, _A_, _C_),
	inside_foldl_1(Tail, _C_, [Ds,O1,O2], _B_).

inside_foldl_1_search([], I_and, _, I_and) :- 
	!.
inside_foldl_1_search([D_445|Tail], I_and, [Ds,O1,O2], _B_) :- 
	during_search(O1, O2, D_445, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	inside_foldl_1_search(Tail, _C_, [Ds,O1,O2], _B_).

inside(O1, O2, Ds, _A_) :- 
	inside_foldl_1(Ds, 1, [Ds,O1,O2], _A_).

inside_search(O1, O2, Ds, _A_) :- 
	inside_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_).

overlap_foldl_1([], I_and, _, I_and) :- 
	!.
overlap_foldl_1([D_446|Tail], I_and, [Ds,O1,O2], _B_) :- 
	overlaps_sym(O1, O2, D_446, _A_),
	fd_and(I_and, _A_, _C_),
	overlap_foldl_1(Tail, _C_, [Ds,O1,O2], _B_).

overlap_foldl_1_search([], I_and, _, I_and) :- 
	!.
overlap_foldl_1_search([D_446|Tail], I_and, [Ds,O1,O2], _B_) :- 
	overlaps_sym_search(O1, O2, D_446, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	overlap_foldl_1_search(Tail, _C_, [Ds,O1,O2], _B_).

overlap(O1, O2, Ds, _A_) :- 
	overlap_foldl_1(Ds, 1, [Ds,O1,O2], _A_).

overlap_search(O1, O2, Ds, _A_) :- 
	overlap_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_).

contains_touch_rcc_foldl_1([], I_and, _, I_and) :- 
	!.
contains_touch_rcc_foldl_1([D_447|Tail], I_and, [Ds,O1,O2], _B_) :- 
	contains_touch(O1, O2, D_447, _A_),
	fd_and(I_and, _A_, _C_),
	contains_touch_rcc_foldl_1(Tail, _C_, [Ds,O1,O2], _B_).

contains_touch_rcc_foldl_1_search([], I_and, _, I_and) :- 
	!.
contains_touch_rcc_foldl_1_search([D_447|Tail], I_and, [Ds,O1,O2], _B_) :- 
	contains_touch_search(O1, O2, D_447, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	contains_touch_rcc_foldl_1_search(Tail, _C_, [Ds,O1,O2], _B_).

contains_touch_rcc(O1, O2, Ds, _A_) :- 
	contains_touch_rcc_foldl_1(Ds, 1, [Ds,O1,O2], _A_).

contains_touch_rcc_search(O1, O2, Ds, _A_) :- 
	contains_touch_rcc_foldl_1_search(Ds, 1, [Ds,O1,O2], _A_).

above(O1, O2, _E_) :- 
	overlap(O1, O2, [1,2], _A_),
	preceded_by(O1, O2, 3, _B_),
	fd_and(_A_, _B_, _C_),
	met_by(O1, O2, 3, _D_),
	fd_or(_C_, _D_, _E_).

above_search(O1, O2, _D_) :- 
	(
	overlap_search(O1, O2, [1,2], _A_),
	rcp_fol_call(_A_),
	preceded_by_search(O1, O2, 3, _B_),
	rcp_fol_call(_B_)
	;
	met_by_search(O1, O2, 3, _C_),
	rcp_fol_call(_C_)
	),
	fd_aeq(_D_, 1).

on_top(O1, O2, _C_) :- 
	overlap(O1, O2, [1,2], _A_),
	met_by(O1, O2, 3, _B_),
	fd_and(_A_, _B_, _C_).

on_top_search(O1, O2, _C_) :- 
	overlap_search(O1, O2, [1,2], _A_),
	rcp_fol_call(_A_),
	met_by_search(O1, O2, 3, _B_),
	rcp_fol_call(_B_),
	fd_aeq(_C_, 1).

stack_oversize_foldl_3([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_3([D_453|Tail], I_and, [Items,Length,O1_448,O2_451], _C_) :- 
	oversize(O1_448, O2_451, D_453, _A_),
	fd_leq(_A_, Length, _B_),
	fd_and(I_and, _B_, _D_),
	stack_oversize_foldl_3(Tail, _D_, [Items,Length,O1_448,O2_451], _C_).

stack_oversize_foldl_3_search([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_3_search([D_453|Tail], I_and, [Items,Length,O1_448,O2_451], _B_) :- 
	oversize_search(O1_448, O2_451, D_453, _A_),
	rcp_fol_call(I_and),
	fd_leq_search(_A_, Length, _C_),
	rcp_fol_call(_C_),
	stack_oversize_foldl_3_search(Tail, _D_, [Items,Length,O1_448,O2_451], _B_).

stack_oversize_foldl_2([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_2([O2_451|Tail], I_and, [Items,Length,O1_448], _H_) :- 
	overlap(O1_448, O2_451, [1,2], _A_),
	rcp_att(uid, O1_448, _B_),
	rcp_att(uid, O2_451, _C_),
	fd_neq(_B_, _C_, _D_),
	fd_and(_A_, _D_, _E_),
	stack_oversize_foldl_3([1,2], 1, [Items,Length,O1_448,O2_451], _F_),
	fd_implies(_E_, _F_, _G_),
	fd_and(I_and, _G_, _I_),
	stack_oversize_foldl_2(Tail, _I_, [Items,Length,O1_448], _H_).

stack_oversize_foldl_2_search([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_2_search([O2_451|Tail], I_and, [Items,Length,O1_448], _J_) :- 
	rcp_att(uid, O1_448, _B_),
	rcp_att(uid, O2_451, _C_),
	rcp_att(uid, O1_448, _F_),
	rcp_att(uid, O2_451, _G_),
	(
	overlap_search(O1_448, O2_451, [1,2], _A_),
	rcp_fol_call(_A_),
	fd_neq(_B_, _C_),
	stack_oversize_foldl_3_search([1,2], 1, [Items,Length,O1_448,O2_451], _H_),
	fd_equiv(_H_, _I_, 1)
	;
	(
	overlap_search(O1_448, O2_451, [1,2], _D_),
	fd_not(_D_, _E_),
	rcp_fol_call(_E_)
	;
	fd_eq(_F_, _G_)
	),
	fd_aeq(_I_, 1)
	),
	rcp_fol_call(I_and),
	rcp_fol_call(_I_),
	stack_oversize_foldl_2_search(Tail, _K_, [Items,Length,O1_448], _J_).

stack_oversize_foldl_1([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_1([O1_448|Tail], I_and, [Items,Length], _B_) :- 
	stack_oversize_foldl_2(Items, 1, [Items,Length,O1_448], _A_),
	fd_and(I_and, _A_, _C_),
	stack_oversize_foldl_1(Tail, _C_, [Items,Length], _B_).

stack_oversize_foldl_1_search([], I_and, _, I_and) :- 
	!.
stack_oversize_foldl_1_search([O1_448|Tail], I_and, [Items,Length], _B_) :- 
	stack_oversize_foldl_2_search(Items, 1, [Items,Length,O1_448], _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	stack_oversize_foldl_1_search(Tail, _C_, [Items,Length], _B_).

stack_oversize(Items, Length, _A_) :- 
	stack_oversize_foldl_1(Items, 1, [Items,Length], _A_).

stack_oversize_search(Items, Length, _A_) :- 
	stack_oversize_foldl_1_search(Items, 1, [Items,Length], _A_).

lighter(O1, O2, _C_) :- 
	rcp_att(weight, O1, _A_),
	rcp_att(weight, O2, _B_),
	fd_leq(_A_, _B_, _C_).

lighter_search(O1, O2, _C_) :- 
	rcp_att(weight, O1, _A_),
	rcp_att(weight, O2, _B_),
	fd_leq(_A_, _B_),
	fd_aeq(_C_, 1).

heavier(O1, O2, _C_) :- 
	rcp_att(weight, O1, _A_),
	rcp_att(weight, O2, _B_),
	fd_geq(_A_, _B_, _C_).

heavier_search(O1, O2, _C_) :- 
	rcp_att(weight, O1, _A_),
	rcp_att(weight, O2, _B_),
	fd_geq(_A_, _B_),
	fd_aeq(_C_, 1).

gravity_foldl_2([], I_or, _, I_or) :- 
	!.
gravity_foldl_2([O2_456|Tail], I_or, [Items,O1_454], _F_) :- 
	rcp_att(uid, O1_454, _A_),
	rcp_att(uid, O2_456, _B_),
	fd_neq(_A_, _B_, _C_),
	on_top(O1_454, O2_456, _D_),
	fd_and(_C_, _D_, _E_),
	fd_or(I_or, _E_, _G_),
	gravity_foldl_2(Tail, _G_, [Items,O1_454], _F_).

gravity_foldl_2_search([], I_or, _, I_or) :- 
	!.
gravity_foldl_2_search([O2_456|Tail], I_or, [Items,O1_454], _D_) :- 
	rcp_att(uid, O1_454, _A_),
	rcp_att(uid, O2_456, _B_),
	(
	rcp_fol_call(I_or)
	;
	fd_neq(_A_, _B_),
	on_top_search(O1_454, O2_456, _C_),
	rcp_fol_call(_C_)
	),
	gravity_foldl_2_search(Tail, _E_, [Items,O1_454], _D_).

gravity_foldl_1([], I_and, _, I_and) :- 
	!.
gravity_foldl_1([O1_454|Tail], I_and, [Items], _E_) :- 
	origin(O1_454, 3, _A_),
	fd_eq(_A_, 0, _B_),
	gravity_foldl_2(Items, 0, [Items,O1_454], _C_),
	fd_or(_B_, _C_, _D_),
	fd_and(I_and, _D_, _F_),
	gravity_foldl_1(Tail, _F_, [Items], _E_).

gravity_foldl_1_search([], I_and, _, I_and) :- 
	!.
gravity_foldl_1_search([O1_454|Tail], I_and, [Items], _C_) :- 
	origin_search(O1_454, 3, _A_),
	rcp_fol_call(I_and),
	(
	fd_eq(_A_, 0)
	;
	gravity_foldl_2_search(Items, 0, [Items,O1_454], _B_),
	rcp_fol_call(_B_)
	),
	gravity_foldl_1_search(Tail, _D_, [Items], _C_).

gravity(Items, _A_) :- 
	gravity_foldl_1(Items, 1, [Items], _A_).

gravity_search(Items, _A_) :- 
	gravity_foldl_1_search(Items, 1, [Items], _A_).

weight_stacking_foldl_2([], I_and, _, I_and) :- 
	!.
weight_stacking_foldl_2([O2_459|Tail], I_and, [Items,O1_457], _H_) :- 
	rcp_att(uid, O1_457, _A_),
	rcp_att(uid, O2_459, _B_),
	fd_neq(_A_, _B_, _C_),
	above(O1_457, O2_459, _D_),
	fd_and(_C_, _D_, _E_),
	lighter(O1_457, O2_459, _F_),
	fd_implies(_E_, _F_, _G_),
	fd_and(I_and, _G_, _I_),
	weight_stacking_foldl_2(Tail, _I_, [Items,O1_457], _H_).

weight_stacking_foldl_2_search([], I_and, _, I_and) :- 
	!.
weight_stacking_foldl_2_search([O2_459|Tail], I_and, [Items,O1_457], _J_) :- 
	rcp_att(uid, O1_457, _A_),
	rcp_att(uid, O2_459, _B_),
	rcp_att(uid, O1_457, _D_),
	rcp_att(uid, O2_459, _E_),
	(
	fd_neq(_A_, _B_),
	above_search(O1_457, O2_459, _C_),
	rcp_fol_call(_C_),
	lighter_search(O1_457, O2_459, _H_),
	fd_equiv(_H_, _I_, 1)
	;
	(
	fd_eq(_D_, _E_)
	;
	above_search(O1_457, O2_459, _F_),
	fd_not(_F_, _G_),
	rcp_fol_call(_G_)
	),
	fd_aeq(_I_, 1)
	),
	rcp_fol_call(I_and),
	rcp_fol_call(_I_),
	weight_stacking_foldl_2_search(Tail, _K_, [Items,O1_457], _J_).

weight_stacking_foldl_1([], I_and, _, I_and) :- 
	!.
weight_stacking_foldl_1([O1_457|Tail], I_and, [Items], _B_) :- 
	weight_stacking_foldl_2(Items, 1, [Items,O1_457], _A_),
	fd_and(I_and, _A_, _C_),
	weight_stacking_foldl_1(Tail, _C_, [Items], _B_).

weight_stacking_foldl_1_search([], I_and, _, I_and) :- 
	!.
weight_stacking_foldl_1_search([O1_457|Tail], I_and, [Items], _B_) :- 
	weight_stacking_foldl_2_search(Items, 1, [Items,O1_457], _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	weight_stacking_foldl_1_search(Tail, _C_, [Items], _B_).

weight_stacking(Items, _A_) :- 
	weight_stacking_foldl_1(Items, 1, [Items], _A_).

weight_stacking_search(Items, _A_) :- 
	weight_stacking_foldl_1_search(Items, 1, [Items], _A_).

weight_balancing_foldr_1([], _, []) :- 
	!.
weight_balancing_foldr_1([Il_460|Tail], [Bin,D,Items,Ratio], [_F_|_G_]) :- 
	weight_balancing_foldr_1(Tail, [Bin,D,Items,Ratio], _G_),
	rcp_att(weight, Il_460, _A_),
	end(Il_460, D, _B_),
	end(Bin, D, _C_),
	fd_aeq(_C_/2, _D_),
	fd_leq(_B_, _D_, _E_),
	fd_aeq(_A_*_E_, _F_).

weight_balancing_foldr_1_search([], _, []) :- 
	!.
weight_balancing_foldr_1_search([Il_460|Tail], [Bin,D,Items,Ratio], [_E_|_F_]) :- 
	weight_balancing_foldr_1_search(Tail, [Bin,D,Items,Ratio], _F_),
	rcp_att(weight, Il_460, _A_),
	end_search(Il_460, D, _B_),
	end_search(Bin, D, _C_),
	fd_aeq(_C_/2, _D_),
	fd_aeq(_A_*fd_leq(_B_,_D_), _E_).

weight_balancing_foldr_2([], _, []) :- 
	!.
weight_balancing_foldr_2([Ir_464|Tail], [Bin,D,Items,Ratio], [_F_|_G_]) :- 
	weight_balancing_foldr_2(Tail, [Bin,D,Items,Ratio], _G_),
	rcp_att(weight, Ir_464, _A_),
	origin(Ir_464, D, _B_),
	end(Bin, D, _C_),
	fd_aeq(_C_/2, _D_),
	fd_geq(_B_, _D_, _E_),
	fd_aeq(_A_*_E_, _F_).

weight_balancing_foldr_2_search([], _, []) :- 
	!.
weight_balancing_foldr_2_search([Ir_464|Tail], [Bin,D,Items,Ratio], [_E_|_F_]) :- 
	weight_balancing_foldr_2_search(Tail, [Bin,D,Items,Ratio], _F_),
	rcp_att(weight, Ir_464, _A_),
	origin_search(Ir_464, D, _B_),
	end_search(Bin, D, _C_),
	fd_aeq(_C_/2, _D_),
	fd_aeq(_A_*fd_geq(_B_,_D_), _E_).

weight_balancing(Items, Bin, D, Ratio, _J_) :- 
	weight_balancing_foldr_1(Items, [Bin,D,Items,Ratio], _A_),
	sum(_A_, _B_),
	L_461=_B_,
	weight_balancing_foldr_2(Items, [Bin,D,Items,Ratio], _C_),
	sum(_C_, _D_),
	R_465=_D_,
	fd_aeq(max(L_461,R_465), _E_),
	fd_aeq(100*_E_, _F_),
	fd_aeq(100+Ratio, _G_),
	fd_aeq(min(L_461,R_465), _H_),
	fd_aeq(_G_*_H_, _I_),
	fd_leq(_F_, _I_, _J_).

weight_balancing_search(Items, Bin, D, Ratio, _J_) :- 
	weight_balancing_foldr_1_search(Items, [Bin,D,Items,Ratio], _A_),
	sum_search(_A_, _B_),
	L_461=_B_,
	weight_balancing_foldr_2_search(Items, [Bin,D,Items,Ratio], _C_),
	sum_search(_C_, _D_),
	R_465=_D_,
	fd_aeq(max(L_461,R_465), _E_),
	fd_aeq(100*_E_, _F_),
	fd_aeq(100+Ratio, _G_),
	fd_aeq(min(L_461,R_465), _H_),
	fd_aeq(_G_*_H_, _I_),
	fd_leq(_F_, _I_),
	fd_aeq(_J_, 1).

object_shape_domain(O, _E_) :- 
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	length(_B_, _C_),
	rcp_range([1.._C_], _D_),
	_A_ in _D_,
	fd_aeq(_E_, 1).

object_shape_domain_search(O, _E_) :- 
	rcp_att(shape_index, O, _A_),
	rcp_att(shapes, O, _B_),
	length(_B_, _C_),
	rcp_range([1.._C_], _D_),
	_A_ in _D_,
	fd_aeq(_E_, 1).

object_shape_domains_foldl_1([], I_and, _, I_and) :- 
	!.
object_shape_domains_foldl_1([I_466|Tail], I_and, [Items], _B_) :- 
	object_shape_domain(I_466, _A_),
	fd_and(I_and, _A_, _C_),
	object_shape_domains_foldl_1(Tail, _C_, [Items], _B_).

object_shape_domains_foldl_1_search([], I_and, _, I_and) :- 
	!.
object_shape_domains_foldl_1_search([I_466|Tail], I_and, [Items], _B_) :- 
	object_shape_domain_search(I_466, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	object_shape_domains_foldl_1_search(Tail, _C_, [Items], _B_).

object_shape_domains(Items, _A_) :- 
	object_shape_domains_foldl_1(Items, 1, [Items], _A_).

object_shape_domains_search(Items, _A_) :- 
	object_shape_domains_foldl_1_search(Items, 1, [Items], _A_).

non_overlapping_binary_foldl_2([], I_and, _, I_and) :- 
	!.
non_overlapping_binary_foldl_2([O2_469|Tail], I_and, [Dims,Items,O1_467], _G_) :- 
	rcp_att(uid, O1_467, _A_),
	rcp_att(uid, O2_469, _B_),
	fd_lt(_A_, _B_, _C_),
	overlap(O1_467, O2_469, Dims, _D_),
	fd_not(_D_, _E_),
	fd_implies(_C_, _E_, _F_),
	fd_and(I_and, _F_, _H_),
	non_overlapping_binary_foldl_2(Tail, _H_, [Dims,Items,O1_467], _G_).

non_overlapping_binary_foldl_2_search([], I_and, _, I_and) :- 
	!.
non_overlapping_binary_foldl_2_search([O2_469|Tail], I_and, [Dims,Items,O1_467], _H_) :- 
	rcp_att(uid, O1_467, _A_),
	rcp_att(uid, O2_469, _B_),
	rcp_att(uid, O1_467, _C_),
	rcp_att(uid, O2_469, _D_),
	(
	fd_lt(_A_, _B_),
	overlap_search(O1_467, O2_469, Dims, _E_),
	fd_not(_E_, _F_),
	fd_equiv(_F_, _G_, 1)
	;
	fd_geq(_C_, _D_),
	fd_aeq(_G_, 1)
	),
	rcp_fol_call(I_and),
	rcp_fol_call(_G_),
	non_overlapping_binary_foldl_2_search(Tail, _I_, [Dims,Items,O1_467], _H_).

non_overlapping_binary_foldl_1([], I_and, _, I_and) :- 
	!.
non_overlapping_binary_foldl_1([O1_467|Tail], I_and, [Dims,Items], _B_) :- 
	non_overlapping_binary_foldl_2(Items, 1, [Dims,Items,O1_467], _A_),
	fd_and(I_and, _A_, _C_),
	non_overlapping_binary_foldl_1(Tail, _C_, [Dims,Items], _B_).

non_overlapping_binary_foldl_1_search([], I_and, _, I_and) :- 
	!.
non_overlapping_binary_foldl_1_search([O1_467|Tail], I_and, [Dims,Items], _B_) :- 
	non_overlapping_binary_foldl_2_search(Items, 1, [Dims,Items,O1_467], _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	non_overlapping_binary_foldl_1_search(Tail, _C_, [Dims,Items], _B_).

non_overlapping_binary(Items, Dims, _A_) :- 
	non_overlapping_binary_foldl_1(Items, 1, [Dims,Items], _A_).

non_overlapping_binary_search(Items, Dims, _A_) :- 
	non_overlapping_binary_foldl_1_search(Items, 1, [Dims,Items], _A_).

containmentAE_foldl_2([], I_or, _, I_or) :- 
	!.
containmentAE_foldl_2([B_472|Tail], I_or, [Bins,Dims,I_470,Items], _B_) :- 
	contains_touch_rcc(B_472, I_470, Dims, _A_),
	fd_or(I_or, _A_, _C_),
	containmentAE_foldl_2(Tail, _C_, [Bins,Dims,I_470,Items], _B_).

containmentAE_foldl_2_search([], I_or, _, I_or) :- 
	!.
containmentAE_foldl_2_search([B_472|Tail], I_or, [Bins,Dims,I_470,Items], _B_) :- 
	contains_touch_rcc_search(B_472, I_470, Dims, _A_),
	(
	rcp_fol_call(I_or)
	;
	rcp_fol_call(_A_)
	),
	containmentAE_foldl_2_search(Tail, _C_, [Bins,Dims,I_470,Items], _B_).

containmentAE_foldl_1([], I_and, _, I_and) :- 
	!.
containmentAE_foldl_1([I_470|Tail], I_and, [Bins,Dims,Items], _B_) :- 
	containmentAE_foldl_2(Bins, 0, [Bins,Dims,I_470,Items], _A_),
	fd_and(I_and, _A_, _C_),
	containmentAE_foldl_1(Tail, _C_, [Bins,Dims,Items], _B_).

containmentAE_foldl_1_search([], I_and, _, I_and) :- 
	!.
containmentAE_foldl_1_search([I_470|Tail], I_and, [Bins,Dims,Items], _B_) :- 
	containmentAE_foldl_2_search(Bins, 0, [Bins,Dims,I_470,Items], _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	containmentAE_foldl_1_search(Tail, _C_, [Bins,Dims,Items], _B_).

containmentAE(Items, Bins, Dims, _A_) :- 
	containmentAE_foldl_1(Items, 1, [Bins,Dims,Items], _A_).

containmentAE_search(Items, Bins, Dims, _A_) :- 
	containmentAE_foldl_1_search(Items, 1, [Bins,Dims,Items], _A_).

bin_packing_binary(Items, Bins, Dims, _C_) :- 
	containmentAE(Items, Bins, Dims, _A_),
	non_overlapping_binary(Items, Dims, _B_),
	fd_and(_A_, _B_, _C_),
	variables(Items, _D_),
	rcp_labeling(_D_).

bin_packing_binary_search(Items, Bins, Dims, _D_) :- 
	variables(Items, _C_),
	containmentAE_search(Items, Bins, Dims, _A_),
	rcp_fol_call(_A_),
	non_overlapping_binary_search(Items, Dims, _B_),
	rcp_fol_call(_B_),
	rcp_labeling(_C_),
	fd_aeq(_D_, 1).

bin_packing(Items, Bins, Dims, _C_) :- 
	containmentAE(Items, Bins, Dims, _A_),
	non_overlapping(Items, Dims, _B_),
	fd_and(_A_, _B_, _C_),
	variables(Items, _D_),
	rcp_labeling(_D_).

bin_packing_search(Items, Bins, Dims, _D_) :- 
	variables(Items, _C_),
	containmentAE_search(Items, Bins, Dims, _A_),
	rcp_fol_call(_A_),
	non_overlapping_search(Items, Dims, _B_),
	rcp_fol_call(_B_),
	rcp_labeling(_C_),
	fd_aeq(_D_, 1).

containmentEA_foldl_2([], I_and, _, I_and) :- 
	!.
containmentEA_foldl_2([I_475|Tail], I_and, [B_473,Bins,Dims,Items], _B_) :- 
	contains_touch_rcc(B_473, I_475, Dims, _A_),
	fd_and(I_and, _A_, _C_),
	containmentEA_foldl_2(Tail, _C_, [B_473,Bins,Dims,Items], _B_).

containmentEA_foldl_2_search([], I_and, _, I_and) :- 
	!.
containmentEA_foldl_2_search([I_475|Tail], I_and, [B_473,Bins,Dims,Items], _B_) :- 
	contains_touch_rcc_search(B_473, I_475, Dims, _A_),
	rcp_fol_call(I_and),
	rcp_fol_call(_A_),
	containmentEA_foldl_2_search(Tail, _C_, [B_473,Bins,Dims,Items], _B_).

containmentEA_foldl_1([], I_or, _, I_or) :- 
	!.
containmentEA_foldl_1([B_473|Tail], I_or, [Bins,Dims,Items], _B_) :- 
	containmentEA_foldl_2(Items, 1, [B_473,Bins,Dims,Items], _A_),
	fd_or(I_or, _A_, _C_),
	containmentEA_foldl_1(Tail, _C_, [Bins,Dims,Items], _B_).

containmentEA_foldl_1_search([], I_or, _, I_or) :- 
	!.
containmentEA_foldl_1_search([B_473|Tail], I_or, [Bins,Dims,Items], _B_) :- 
	containmentEA_foldl_2_search(Items, 1, [B_473,Bins,Dims,Items], _A_),
	(
	rcp_fol_call(I_or)
	;
	rcp_fol_call(_A_)
	),
	containmentEA_foldl_1_search(Tail, _C_, [Bins,Dims,Items], _B_).

containmentEA(Items, Bins, Dims, _A_) :- 
	containmentEA_foldl_1(Bins, 0, [Bins,Dims,Items], _A_).

containmentEA_search(Items, Bins, Dims, _A_) :- 
	containmentEA_foldl_1_search(Bins, 0, [Bins,Dims,Items], _A_).

bin_design(Bin, Items, Dims, _C_) :- 
	containmentEA(Items, [Bin], Dims, _A_),
	non_overlapping(Items, Dims, _B_),
	fd_and(_A_, _B_, _C_),
	volume(Bin, _E_),
	minimize(((variables(Items,_D_),rcp_labeling(_D_)),rcp_labeling([_E_])), _E_),
	true.

bin_design_search(Bin, Items, Dims, _E_) :- 
	volume(Bin, _D_),
	minimize(((variables(Items,_C_),rcp_labeling(_C_)),rcp_labeling([_D_])), _D_),
	containmentEA_search(Items, [Bin], Dims, _A_),
	rcp_fol_call(_A_),
	non_overlapping_search(Items, Dims, _B_),
	rcp_fol_call(_B_),
	fd_aeq(_E_, 1).

items_domain_foldl_1([], I_and, _, I_and) :- 
	!.
items_domain_foldl_1([I_476|Tail], I_and, [Bin,Items], _P_) :- 
	x(I_476, _A_),
	variables(_A_, _B_),
	w(Bin, _C_),
	w(I_476, _D_),
	fd_aeq(_C_-_D_, _E_),
	y(I_476, _F_),
	variables(_F_, _G_),
	h(Bin, _H_),
	h(I_476, _I_),
	fd_aeq(_H_-_I_, _J_),
	z(I_476, _K_),
	variables(_K_, _L_),
	l(Bin, _M_),
	l(I_476, _N_),
	fd_aeq(_M_-_N_, _O_),
	domain(_L_, 0, _O_),
	domain(_B_, 0, _E_),
	domain(_G_, 0, _J_),
	items_domain_foldl_1(Tail, I_and, [Bin,Items], _P_).

items_domain_foldl_1_search([], I_and, _, I_and) :- 
	!.
items_domain_foldl_1_search([I_476|Tail], I_and, [Bin,Items], _P_) :- 
	x_search(I_476, _A_),
	variables(_A_, _B_),
	w_search(Bin, _C_),
	w_search(I_476, _D_),
	fd_aeq(_C_-_D_, _E_),
	y_search(I_476, _F_),
	variables(_F_, _G_),
	h_search(Bin, _H_),
	h_search(I_476, _I_),
	fd_aeq(_H_-_I_, _J_),
	z_search(I_476, _K_),
	variables(_K_, _L_),
	l_search(Bin, _M_),
	l_search(I_476, _N_),
	fd_aeq(_M_-_N_, _O_),
	rcp_fol_call(I_and),
	domain(_B_, 0, _E_),
	domain(_G_, 0, _J_),
	domain(_L_, 0, _O_),
	items_domain_foldl_1_search(Tail, _Q_, [Bin,Items], _P_).

items_domain(Items, Bin, _A_) :- 
	items_domain_foldl_1(Items, 1, [Bin,Items], _A_).

items_domain_search(Items, Bin, _A_) :- 
	items_domain_foldl_1_search(Items, 1, [Bin,Items], _A_).

var_order_criterion(1, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	rcp_att(weight, _A_, _B_).
var_order_criterion(2, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	volume(_A_, _B_).
var_order_criterion(3, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	z(_A_, _B_).

val_order_criterion(1, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	z(_A_, _B_).
val_order_criterion(2, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	x(_A_, _B_).
val_order_criterion(3, Candidate, [], _B_) :- 
	rcp_call(Candidate, _A_),
	y(_A_, _B_).

psa_bin_packing(Bin, Items, Dims, _K_) :- 
	items_domain(Items, Bin, _A_),
	gravity(Items, _B_),
	fd_and(_A_, _B_, _C_),
	weight_stacking(Items, _D_),
	fd_and(_C_, _D_, _E_),
	weight_balancing(Items, Bin, 1, 20, _F_),
	fd_and(_E_, _F_, _G_),
	stack_oversize(Items, 10, _H_),
	fd_and(_G_, _H_, _I_),
	variable_ordering([greatest(var_order_criterion(1,[])),greatest(var_order_criterion(2,[])),is(var_order_criterion(3,[]))]),
	value_ordering([up(val_order_criterion(1,[])),bisect(val_order_criterion(2,[])),bisect(val_order_criterion(3,[]))]),
	bin_packing(Items, [Bin], Dims, _J_),
	fd_and(_I_, _J_, _K_).

psa_bin_packing_search(Bin, Items, Dims, _G_) :- 
	items_domain_search(Items, Bin, _A_),
	rcp_fol_call(_A_),
	gravity_search(Items, _B_),
	rcp_fol_call(_B_),
	weight_stacking_search(Items, _C_),
	rcp_fol_call(_C_),
	weight_balancing_search(Items, Bin, 1, 20, _D_),
	rcp_fol_call(_D_),
	stack_oversize_search(Items, 10, _E_),
	rcp_fol_call(_E_),
	variable_ordering([greatest(var_order_criterion(1,[])),greatest(var_order_criterion(2,[])),is(var_order_criterion(3,[]))]),
	value_ordering([up(val_order_criterion(1,[])),bisect(val_order_criterion(2,[])),bisect(val_order_criterion(3,[]))]),
	bin_packing_search(Items, [Bin], Dims, _F_),
	rcp_fol_call(_F_),
	fd_aeq(_G_, 1).

solve([O2,O2_2,O2_3,O3,O3_2,O3_3,O4,O4_2,O4_3,O5,O5_2,O5_3,O6,O6_2,O6_3,O7,O7_2,O7_3,O8,O8_2,O8_3,O9,O9_2,O9_3,O10,O10_2,O10_3]) :- 
	R_477#<=>O2+224#=<601,
	R_478#<=>O3+224#=<601,
	R_479#<=>O4+224#=<601,
	R_480#<=>O5+224#=<601,
	R_481#<=>O6+224#=<601,
	R_482#<=>O7+224#=<601,
	R_483#<=>O8+224#=<601,
	R_484#<=>O9+155#=<601,
	R_485#<=>O10+112#=<601,
	R_486#<=>O2#>=601,
	R_487#<=>O3#>=601,
	R_488#<=>O4#>=601,
	R_489#<=>O5#>=601,
	R_490#<=>O6#>=601,
	R_491#<=>O7#>=601,
	R_492#<=>O8#>=601,
	R_493#<=>O9#>=601,
	R_494#<=>O10#>=601,
	R_495#<=>O2+224#=<601,
	R_496#<=>O3+224#=<601,
	R_497#<=>O4+224#=<601,
	R_498#<=>O5+224#=<601,
	R_499#<=>O6+224#=<601,
	R_500#<=>O7+224#=<601,
	R_501#<=>O8+224#=<601,
	R_502#<=>O9+155#=<601,
	R_503#<=>O10+112#=<601,
	R_504#<=>O2#>=601,
	R_505#<=>O3#>=601,
	R_506#<=>O4#>=601,
	R_507#<=>O5#>=601,
	R_508#<=>O6#>=601,
	R_509#<=>O7#>=601,
	R_510#<=>O8#>=601,
	R_511#<=>O9#>=601,
	R_512#<=>O10#>=601,
	rcp_var(from(o2,0,1), O2),
	rcp_var(from(o2,0,2), O2_2),
	rcp_var(from(o2,0,3), O2_3),
	rcp_var(from(o3,0,1), O3),
	rcp_var(from(o3,0,2), O3_2),
	rcp_var(from(o3,0,3), O3_3),
	rcp_var(from(o4,0,1), O4),
	rcp_var(from(o4,0,2), O4_2),
	rcp_var(from(o4,0,3), O4_3),
	rcp_var(from(o5,0,1), O5),
	rcp_var(from(o5,0,2), O5_2),
	rcp_var(from(o5,0,3), O5_3),
	rcp_var(from(o6,0,1), O6),
	rcp_var(from(o6,0,2), O6_2),
	rcp_var(from(o6,0,3), O6_3),
	rcp_var(from(o7,0,1), O7),
	rcp_var(from(o7,0,2), O7_2),
	rcp_var(from(o7,0,3), O7_3),
	rcp_var(from(o8,0,1), O8),
	rcp_var(from(o8,0,2), O8_2),
	rcp_var(from(o8,0,3), O8_3),
	rcp_var(from(o9,0,1), O9),
	rcp_var(from(o9,0,2), O9_2),
	rcp_var(from(o9,0,3), O9_3),
	rcp_var(from(o10,0,1), O10),
	rcp_var(from(o10,0,2), O10_2),
	rcp_var(from(o10,0,3), O10_3),
	domain([O2], 0, 979),
	domain([O2_2], 0, 11),
	domain([O2_3], 0, 128),
	domain([O3], 0, 979),
	domain([O3_2], 0, 11),
	domain([O3_3], 0, 165),
	domain([O4], 0, 979),
	domain([O4_2], 0, 11),
	domain([O4_3], 0, 165),
	domain([O5], 0, 979),
	domain([O5_2], 0, 11),
	domain([O5_3], 0, 91),
	domain([O6], 0, 979),
	domain([O6_2], 0, 11),
	domain([O6_3], 0, 128),
	domain([O7], 0, 979),
	domain([O7_2], 0, 11),
	domain([O7_3], 0, 128),
	domain([O8], 0, 979),
	domain([O8_2], 0, 11),
	domain([O8_3], 0, 17),
	domain([O9], 0, 1048),
	domain([O9_2], 0, 11),
	domain([O9_3], 0, 17),
	domain([O10], 0, 1091),
	domain([O10_2], 0, 11),
	domain([O10_3], 0, 91),
	O2_3#=0#\/(O2+224#>O3#/\O3+224#>O2#/\(O2_2+224#>O3_2#/\O3_2+224#>O2_2)#/\O3_3+74#=O2_3#\/(O2+224#>O4#/\O4+224#>O2#/\(O2_2+224#>O4_2#/\O4_2+224#>O2_2)#/\O4_3+74#=O2_3#\/(O2+224#>O5#/\O5+224#>O2#/\(O2_2+224#>O5_2#/\O5_2+224#>O2_2)#/\O5_3+148#=O2_3#\/(O2+224#>O6#/\O6+224#>O2#/\(O2_2+224#>O6_2#/\O6_2+224#>O2_2)#/\O6_3+111#=O2_3#\/(O2+224#>O7#/\O7+224#>O2#/\(O2_2+224#>O7_2#/\O7_2+224#>O2_2)#/\O7_3+111#=O2_3#\/(O2+224#>O8#/\O8+224#>O2#/\(O2_2+224#>O8_2#/\O8_2+224#>O2_2)#/\O8_3+222#=O2_3#\/(O2+224#>O9#/\O9+155#>O2#/\(O2_2+224#>O9_2#/\O9_2+224#>O2_2)#/\O9_3+222#=O2_3#\/O2+224#>O10#/\O10+112#>O2#/\(O2_2+224#>O10_2#/\O10_2+224#>O2_2)#/\O10_3+148#=O2_3))))))),
	O3_3#=0#\/(O3+224#>O2#/\O2+224#>O3#/\(O3_2+224#>O2_2#/\O2_2+224#>O3_2)#/\O2_3+111#=O3_3#\/(O3+224#>O4#/\O4+224#>O3#/\(O3_2+224#>O4_2#/\O4_2+224#>O3_2)#/\O4_3+74#=O3_3#\/(O3+224#>O5#/\O5+224#>O3#/\(O3_2+224#>O5_2#/\O5_2+224#>O3_2)#/\O5_3+148#=O3_3#\/(O3+224#>O6#/\O6+224#>O3#/\(O3_2+224#>O6_2#/\O6_2+224#>O3_2)#/\O6_3+111#=O3_3#\/(O3+224#>O7#/\O7+224#>O3#/\(O3_2+224#>O7_2#/\O7_2+224#>O3_2)#/\O7_3+111#=O3_3#\/(O3+224#>O8#/\O8+224#>O3#/\(O3_2+224#>O8_2#/\O8_2+224#>O3_2)#/\O8_3+222#=O3_3#\/(O3+224#>O9#/\O9+155#>O3#/\(O3_2+224#>O9_2#/\O9_2+224#>O3_2)#/\O9_3+222#=O3_3#\/O3+224#>O10#/\O10+112#>O3#/\(O3_2+224#>O10_2#/\O10_2+224#>O3_2)#/\O10_3+148#=O3_3))))))),
	O4_3#=0#\/(O4+224#>O2#/\O2+224#>O4#/\(O4_2+224#>O2_2#/\O2_2+224#>O4_2)#/\O2_3+111#=O4_3#\/(O4+224#>O3#/\O3+224#>O4#/\(O4_2+224#>O3_2#/\O3_2+224#>O4_2)#/\O3_3+74#=O4_3#\/(O4+224#>O5#/\O5+224#>O4#/\(O4_2+224#>O5_2#/\O5_2+224#>O4_2)#/\O5_3+148#=O4_3#\/(O4+224#>O6#/\O6+224#>O4#/\(O4_2+224#>O6_2#/\O6_2+224#>O4_2)#/\O6_3+111#=O4_3#\/(O4+224#>O7#/\O7+224#>O4#/\(O4_2+224#>O7_2#/\O7_2+224#>O4_2)#/\O7_3+111#=O4_3#\/(O4+224#>O8#/\O8+224#>O4#/\(O4_2+224#>O8_2#/\O8_2+224#>O4_2)#/\O8_3+222#=O4_3#\/(O4+224#>O9#/\O9+155#>O4#/\(O4_2+224#>O9_2#/\O9_2+224#>O4_2)#/\O9_3+222#=O4_3#\/O4+224#>O10#/\O10+112#>O4#/\(O4_2+224#>O10_2#/\O10_2+224#>O4_2)#/\O10_3+148#=O4_3))))))),
	O5_3#=0#\/(O5+224#>O2#/\O2+224#>O5#/\(O5_2+224#>O2_2#/\O2_2+224#>O5_2)#/\O2_3+111#=O5_3#\/(O5+224#>O3#/\O3+224#>O5#/\(O5_2+224#>O3_2#/\O3_2+224#>O5_2)#/\O3_3+74#=O5_3#\/(O5+224#>O4#/\O4+224#>O5#/\(O5_2+224#>O4_2#/\O4_2+224#>O5_2)#/\O4_3+74#=O5_3#\/(O5+224#>O6#/\O6+224#>O5#/\(O5_2+224#>O6_2#/\O6_2+224#>O5_2)#/\O6_3+111#=O5_3#\/(O5+224#>O7#/\O7+224#>O5#/\(O5_2+224#>O7_2#/\O7_2+224#>O5_2)#/\O7_3+111#=O5_3#\/(O5+224#>O8#/\O8+224#>O5#/\(O5_2+224#>O8_2#/\O8_2+224#>O5_2)#/\O8_3+222#=O5_3#\/(O5+224#>O9#/\O9+155#>O5#/\(O5_2+224#>O9_2#/\O9_2+224#>O5_2)#/\O9_3+222#=O5_3#\/O5+224#>O10#/\O10+112#>O5#/\(O5_2+224#>O10_2#/\O10_2+224#>O5_2)#/\O10_3+148#=O5_3))))))),
	O6_3#=0#\/(O6+224#>O2#/\O2+224#>O6#/\(O6_2+224#>O2_2#/\O2_2+224#>O6_2)#/\O2_3+111#=O6_3#\/(O6+224#>O3#/\O3+224#>O6#/\(O6_2+224#>O3_2#/\O3_2+224#>O6_2)#/\O3_3+74#=O6_3#\/(O6+224#>O4#/\O4+224#>O6#/\(O6_2+224#>O4_2#/\O4_2+224#>O6_2)#/\O4_3+74#=O6_3#\/(O6+224#>O5#/\O5+224#>O6#/\(O6_2+224#>O5_2#/\O5_2+224#>O6_2)#/\O5_3+148#=O6_3#\/(O6+224#>O7#/\O7+224#>O6#/\(O6_2+224#>O7_2#/\O7_2+224#>O6_2)#/\O7_3+111#=O6_3#\/(O6+224#>O8#/\O8+224#>O6#/\(O6_2+224#>O8_2#/\O8_2+224#>O6_2)#/\O8_3+222#=O6_3#\/(O6+224#>O9#/\O9+155#>O6#/\(O6_2+224#>O9_2#/\O9_2+224#>O6_2)#/\O9_3+222#=O6_3#\/O6+224#>O10#/\O10+112#>O6#/\(O6_2+224#>O10_2#/\O10_2+224#>O6_2)#/\O10_3+148#=O6_3))))))),
	O7_3#=0#\/(O7+224#>O2#/\O2+224#>O7#/\(O7_2+224#>O2_2#/\O2_2+224#>O7_2)#/\O2_3+111#=O7_3#\/(O7+224#>O3#/\O3+224#>O7#/\(O7_2+224#>O3_2#/\O3_2+224#>O7_2)#/\O3_3+74#=O7_3#\/(O7+224#>O4#/\O4+224#>O7#/\(O7_2+224#>O4_2#/\O4_2+224#>O7_2)#/\O4_3+74#=O7_3#\/(O7+224#>O5#/\O5+224#>O7#/\(O7_2+224#>O5_2#/\O5_2+224#>O7_2)#/\O5_3+148#=O7_3#\/(O7+224#>O6#/\O6+224#>O7#/\(O7_2+224#>O6_2#/\O6_2+224#>O7_2)#/\O6_3+111#=O7_3#\/(O7+224#>O8#/\O8+224#>O7#/\(O7_2+224#>O8_2#/\O8_2+224#>O7_2)#/\O8_3+222#=O7_3#\/(O7+224#>O9#/\O9+155#>O7#/\(O7_2+224#>O9_2#/\O9_2+224#>O7_2)#/\O9_3+222#=O7_3#\/O7+224#>O10#/\O10+112#>O7#/\(O7_2+224#>O10_2#/\O10_2+224#>O7_2)#/\O10_3+148#=O7_3))))))),
	O8_3#=0#\/(O8+224#>O2#/\O2+224#>O8#/\(O8_2+224#>O2_2#/\O2_2+224#>O8_2)#/\O2_3+111#=O8_3#\/(O8+224#>O3#/\O3+224#>O8#/\(O8_2+224#>O3_2#/\O3_2+224#>O8_2)#/\O3_3+74#=O8_3#\/(O8+224#>O4#/\O4+224#>O8#/\(O8_2+224#>O4_2#/\O4_2+224#>O8_2)#/\O4_3+74#=O8_3#\/(O8+224#>O5#/\O5+224#>O8#/\(O8_2+224#>O5_2#/\O5_2+224#>O8_2)#/\O5_3+148#=O8_3#\/(O8+224#>O6#/\O6+224#>O8#/\(O8_2+224#>O6_2#/\O6_2+224#>O8_2)#/\O6_3+111#=O8_3#\/(O8+224#>O7#/\O7+224#>O8#/\(O8_2+224#>O7_2#/\O7_2+224#>O8_2)#/\O7_3+111#=O8_3#\/(O8+224#>O9#/\O9+155#>O8#/\(O8_2+224#>O9_2#/\O9_2+224#>O8_2)#/\O9_3+222#=O8_3#\/O8+224#>O10#/\O10+112#>O8#/\(O8_2+224#>O10_2#/\O10_2+224#>O8_2)#/\O10_3+148#=O8_3))))))),
	O9_3#=0#\/(O9+155#>O2#/\O2+224#>O9#/\(O9_2+224#>O2_2#/\O2_2+224#>O9_2)#/\O2_3+111#=O9_3#\/(O9+155#>O3#/\O3+224#>O9#/\(O9_2+224#>O3_2#/\O3_2+224#>O9_2)#/\O3_3+74#=O9_3#\/(O9+155#>O4#/\O4+224#>O9#/\(O9_2+224#>O4_2#/\O4_2+224#>O9_2)#/\O4_3+74#=O9_3#\/(O9+155#>O5#/\O5+224#>O9#/\(O9_2+224#>O5_2#/\O5_2+224#>O9_2)#/\O5_3+148#=O9_3#\/(O9+155#>O6#/\O6+224#>O9#/\(O9_2+224#>O6_2#/\O6_2+224#>O9_2)#/\O6_3+111#=O9_3#\/(O9+155#>O7#/\O7+224#>O9#/\(O9_2+224#>O7_2#/\O7_2+224#>O9_2)#/\O7_3+111#=O9_3#\/(O9+155#>O8#/\O8+224#>O9#/\(O9_2+224#>O8_2#/\O8_2+224#>O9_2)#/\O8_3+222#=O9_3#\/O9+155#>O10#/\O10+112#>O9#/\(O9_2+224#>O10_2#/\O10_2+224#>O9_2)#/\O10_3+148#=O9_3))))))),
	O10_3#=0#\/(O10+112#>O2#/\O2+224#>O10#/\(O10_2+224#>O2_2#/\O2_2+224#>O10_2)#/\O2_3+111#=O10_3#\/(O10+112#>O3#/\O3+224#>O10#/\(O10_2+224#>O3_2#/\O3_2+224#>O10_2)#/\O3_3+74#=O10_3#\/(O10+112#>O4#/\O4+224#>O10#/\(O10_2+224#>O4_2#/\O4_2+224#>O10_2)#/\O4_3+74#=O10_3#\/(O10+112#>O5#/\O5+224#>O10#/\(O10_2+224#>O5_2#/\O5_2+224#>O10_2)#/\O5_3+148#=O10_3#\/(O10+112#>O6#/\O6+224#>O10#/\(O10_2+224#>O6_2#/\O6_2+224#>O10_2)#/\O6_3+111#=O10_3#\/(O10+112#>O7#/\O7+224#>O10#/\(O10_2+224#>O7_2#/\O7_2+224#>O10_2)#/\O7_3+111#=O10_3#\/(O10+112#>O8#/\O8+224#>O10#/\(O10_2+224#>O8_2#/\O8_2+224#>O10_2)#/\O8_3+222#=O10_3#\/O10+112#>O9#/\O9+155#>O10#/\(O10_2+224#>O9_2#/\O9_2+224#>O10_2)#/\O9_3+222#=O10_3))))))),
	O2+224#=<O6#\/O6+224#=<O2#\/(O2_2+224#=<O6_2#\/O6_2+224#=<O2_2)#\/O6_3+111#>=O2_3,
	O6_3+111#\=O2_3,
	O2+224#=<O7#\/O7+224#=<O2#\/(O2_2+224#=<O7_2#\/O7_2+224#=<O2_2)#\/O7_3+111#>=O2_3,
	O7_3+111#\=O2_3,
	O2+224#=<O10#\/O10+112#=<O2#\/(O2_2+224#=<O10_2#\/O10_2+224#=<O2_2)#\/O10_3+148#>=O2_3,
	O10_3+148#\=O2_3,
	O3+224#=<O2#\/O2+224#=<O3#\/(O3_2+224#=<O2_2#\/O2_2+224#=<O3_2)#\/O2_3+111#>=O3_3,
	O2_3+111#\=O3_3,
	O3+224#=<O5#\/O5+224#=<O3#\/(O3_2+224#=<O5_2#\/O5_2+224#=<O3_2)#\/O5_3+148#>=O3_3,
	O5_3+148#\=O3_3,
	O3+224#=<O6#\/O6+224#=<O3#\/(O3_2+224#=<O6_2#\/O6_2+224#=<O3_2)#\/O6_3+111#>=O3_3,
	O6_3+111#\=O3_3,
	O3+224#=<O7#\/O7+224#=<O3#\/(O3_2+224#=<O7_2#\/O7_2+224#=<O3_2)#\/O7_3+111#>=O3_3,
	O7_3+111#\=O3_3,
	O3+224#=<O9#\/O9+155#=<O3#\/(O3_2+224#=<O9_2#\/O9_2+224#=<O3_2)#\/O9_3+222#>=O3_3,
	O9_3+222#\=O3_3,
	O3+224#=<O10#\/O10+112#=<O3#\/(O3_2+224#=<O10_2#\/O10_2+224#=<O3_2)#\/O10_3+148#>=O3_3,
	O10_3+148#\=O3_3,
	O4+224#=<O2#\/O2+224#=<O4#\/(O4_2+224#=<O2_2#\/O2_2+224#=<O4_2)#\/O2_3+111#>=O4_3,
	O2_3+111#\=O4_3,
	O4+224#=<O3#\/O3+224#=<O4#\/(O4_2+224#=<O3_2#\/O3_2+224#=<O4_2)#\/O3_3+74#>=O4_3,
	O3_3+74#\=O4_3,
	O4+224#=<O5#\/O5+224#=<O4#\/(O4_2+224#=<O5_2#\/O5_2+224#=<O4_2)#\/O5_3+148#>=O4_3,
	O5_3+148#\=O4_3,
	O4+224#=<O6#\/O6+224#=<O4#\/(O4_2+224#=<O6_2#\/O6_2+224#=<O4_2)#\/O6_3+111#>=O4_3,
	O6_3+111#\=O4_3,
	O4+224#=<O7#\/O7+224#=<O4#\/(O4_2+224#=<O7_2#\/O7_2+224#=<O4_2)#\/O7_3+111#>=O4_3,
	O7_3+111#\=O4_3,
	O4+224#=<O8#\/O8+224#=<O4#\/(O4_2+224#=<O8_2#\/O8_2+224#=<O4_2)#\/O8_3+222#>=O4_3,
	O8_3+222#\=O4_3,
	O4+224#=<O9#\/O9+155#=<O4#\/(O4_2+224#=<O9_2#\/O9_2+224#=<O4_2)#\/O9_3+222#>=O4_3,
	O9_3+222#\=O4_3,
	O4+224#=<O10#\/O10+112#=<O4#\/(O4_2+224#=<O10_2#\/O10_2+224#=<O4_2)#\/O10_3+148#>=O4_3,
	O10_3+148#\=O4_3,
	O5+224#=<O2#\/O2+224#=<O5#\/(O5_2+224#=<O2_2#\/O2_2+224#=<O5_2)#\/O2_3+111#>=O5_3,
	O2_3+111#\=O5_3,
	O5+224#=<O6#\/O6+224#=<O5#\/(O5_2+224#=<O6_2#\/O6_2+224#=<O5_2)#\/O6_3+111#>=O5_3,
	O6_3+111#\=O5_3,
	O5+224#=<O7#\/O7+224#=<O5#\/(O5_2+224#=<O7_2#\/O7_2+224#=<O5_2)#\/O7_3+111#>=O5_3,
	O7_3+111#\=O5_3,
	O5+224#=<O10#\/O10+112#=<O5#\/(O5_2+224#=<O10_2#\/O10_2+224#=<O5_2)#\/O10_3+148#>=O5_3,
	O10_3+148#\=O5_3,
	O7+224#=<O6#\/O6+224#=<O7#\/(O7_2+224#=<O6_2#\/O6_2+224#=<O7_2)#\/O6_3+111#>=O7_3,
	O6_3+111#\=O7_3,
	O8+224#=<O2#\/O2+224#=<O8#\/(O8_2+224#=<O2_2#\/O2_2+224#=<O8_2)#\/O2_3+111#>=O8_3,
	O2_3+111#\=O8_3,
	O8+224#=<O3#\/O3+224#=<O8#\/(O8_2+224#=<O3_2#\/O3_2+224#=<O8_2)#\/O3_3+74#>=O8_3,
	O3_3+74#\=O8_3,
	O8+224#=<O5#\/O5+224#=<O8#\/(O8_2+224#=<O5_2#\/O5_2+224#=<O8_2)#\/O5_3+148#>=O8_3,
	O5_3+148#\=O8_3,
	O8+224#=<O6#\/O6+224#=<O8#\/(O8_2+224#=<O6_2#\/O6_2+224#=<O8_2)#\/O6_3+111#>=O8_3,
	O6_3+111#\=O8_3,
	O8+224#=<O7#\/O7+224#=<O8#\/(O8_2+224#=<O7_2#\/O7_2+224#=<O8_2)#\/O7_3+111#>=O8_3,
	O7_3+111#\=O8_3,
	O8+224#=<O9#\/O9+155#=<O8#\/(O8_2+224#=<O9_2#\/O9_2+224#=<O8_2)#\/O9_3+222#>=O8_3,
	O9_3+222#\=O8_3,
	O8+224#=<O10#\/O10+112#=<O8#\/(O8_2+224#=<O10_2#\/O10_2+224#=<O8_2)#\/O10_3+148#>=O8_3,
	O10_3+148#\=O8_3,
	O9+155#=<O2#\/O2+224#=<O9#\/(O9_2+224#=<O2_2#\/O2_2+224#=<O9_2)#\/O2_3+111#>=O9_3,
	O2_3+111#\=O9_3,
	O9+155#=<O5#\/O5+224#=<O9#\/(O9_2+224#=<O5_2#\/O5_2+224#=<O9_2)#\/O5_3+148#>=O9_3,
	O5_3+148#\=O9_3,
	O9+155#=<O6#\/O6+224#=<O9#\/(O9_2+224#=<O6_2#\/O6_2+224#=<O9_2)#\/O6_3+111#>=O9_3,
	O6_3+111#\=O9_3,
	O9+155#=<O7#\/O7+224#=<O9#\/(O9_2+224#=<O7_2#\/O7_2+224#=<O9_2)#\/O7_3+111#>=O9_3,
	O7_3+111#\=O9_3,
	O9+155#=<O10#\/O10+112#=<O9#\/(O9_2+224#=<O10_2#\/O10_2+224#=<O9_2)#\/O10_3+148#>=O9_3,
	O10_3+148#\=O9_3,
	O10+112#=<O6#\/O6+224#=<O10#\/(O10_2+224#=<O6_2#\/O6_2+224#=<O10_2)#\/O6_3+111#>=O10_3,
	O6_3+111#\=O10_3,
	O10+112#=<O7#\/O7+224#=<O10#\/(O10_2+224#=<O7_2#\/O7_2+224#=<O10_2)#\/O7_3+111#>=O10_3,
	O7_3+111#\=O10_3,
	100*max(413*R_477+(463*R_478+(842*R_479+(422*R_480+(266*R_481+(321*R_482+(670*R_483+(440*R_484+325*R_485))))))),413*R_486+(463*R_487+(842*R_488+(422*R_489+(266*R_490+(321*R_491+(670*R_492+(440*R_493+325*R_494))))))))#=<120*min(413*R_495+(463*R_496+(842*R_497+(422*R_498+(266*R_499+(321*R_500+(670*R_501+(440*R_502+325*R_503))))))),413*R_504+(463*R_505+(842*R_506+(422*R_507+(266*R_508+(321*R_509+(670*R_510+(440*R_511+325*R_512)))))))),
	O2+224#>O3#/\O3+224#>O2#/\(O2_2+224#>O3_2#/\O3_2+224#>O2_2)#=>max(max(O2,O3)-min(O2,O3),max(O2+224,O3+224)-min(O2+224,O3+224))#=<10#/\max(max(O2_2,O3_2)-min(O2_2,O3_2),max(O2_2+224,O3_2+224)-min(O2_2+224,O3_2+224))#=<10,
	O2+224#>O4#/\O4+224#>O2#/\(O2_2+224#>O4_2#/\O4_2+224#>O2_2)#=>max(max(O2,O4)-min(O2,O4),max(O2+224,O4+224)-min(O2+224,O4+224))#=<10#/\max(max(O2_2,O4_2)-min(O2_2,O4_2),max(O2_2+224,O4_2+224)-min(O2_2+224,O4_2+224))#=<10,
	O2+224#>O5#/\O5+224#>O2#/\(O2_2+224#>O5_2#/\O5_2+224#>O2_2)#=>max(max(O2,O5)-min(O2,O5),max(O2+224,O5+224)-min(O2+224,O5+224))#=<10#/\max(max(O2_2,O5_2)-min(O2_2,O5_2),max(O2_2+224,O5_2+224)-min(O2_2+224,O5_2+224))#=<10,
	O2+224#>O6#/\O6+224#>O2#/\(O2_2+224#>O6_2#/\O6_2+224#>O2_2)#=>max(max(O2,O6)-min(O2,O6),max(O2+224,O6+224)-min(O2+224,O6+224))#=<10#/\max(max(O2_2,O6_2)-min(O2_2,O6_2),max(O2_2+224,O6_2+224)-min(O2_2+224,O6_2+224))#=<10,
	O2+224#>O7#/\O7+224#>O2#/\(O2_2+224#>O7_2#/\O7_2+224#>O2_2)#=>max(max(O2,O7)-min(O2,O7),max(O2+224,O7+224)-min(O2+224,O7+224))#=<10#/\max(max(O2_2,O7_2)-min(O2_2,O7_2),max(O2_2+224,O7_2+224)-min(O2_2+224,O7_2+224))#=<10,
	O2+224#>O8#/\O8+224#>O2#/\(O2_2+224#>O8_2#/\O8_2+224#>O2_2)#=>max(max(O2,O8)-min(O2,O8),max(O2+224,O8+224)-min(O2+224,O8+224))#=<10#/\max(max(O2_2,O8_2)-min(O2_2,O8_2),max(O2_2+224,O8_2+224)-min(O2_2+224,O8_2+224))#=<10,
	O2+224#>O9#/\O9+155#>O2#/\(O2_2+224#>O9_2#/\O9_2+224#>O2_2)#=>max(max(O2,O9)-min(O2,O9),max(O2+224,O9+155)-min(O2+224,O9+155))#=<10#/\max(max(O2_2,O9_2)-min(O2_2,O9_2),max(O2_2+224,O9_2+224)-min(O2_2+224,O9_2+224))#=<10,
	O2+224#>O10#/\O10+112#>O2#/\(O2_2+224#>O10_2#/\O10_2+224#>O2_2)#=>max(max(O2,O10)-min(O2,O10),max(O2+224,O10+112)-min(O2+224,O10+112))#=<10#/\max(max(O2_2,O10_2)-min(O2_2,O10_2),max(O2_2+224,O10_2+224)-min(O2_2+224,O10_2+224))#=<10,
	O3+224#>O2#/\O2+224#>O3#/\(O3_2+224#>O2_2#/\O2_2+224#>O3_2)#=>max(max(O3,O2)-min(O3,O2),max(O3+224,O2+224)-min(O3+224,O2+224))#=<10#/\max(max(O3_2,O2_2)-min(O3_2,O2_2),max(O3_2+224,O2_2+224)-min(O3_2+224,O2_2+224))#=<10,
	O3+224#>O4#/\O4+224#>O3#/\(O3_2+224#>O4_2#/\O4_2+224#>O3_2)#=>max(max(O3,O4)-min(O3,O4),max(O3+224,O4+224)-min(O3+224,O4+224))#=<10#/\max(max(O3_2,O4_2)-min(O3_2,O4_2),max(O3_2+224,O4_2+224)-min(O3_2+224,O4_2+224))#=<10,
	O3+224#>O5#/\O5+224#>O3#/\(O3_2+224#>O5_2#/\O5_2+224#>O3_2)#=>max(max(O3,O5)-min(O3,O5),max(O3+224,O5+224)-min(O3+224,O5+224))#=<10#/\max(max(O3_2,O5_2)-min(O3_2,O5_2),max(O3_2+224,O5_2+224)-min(O3_2+224,O5_2+224))#=<10,
	O3+224#>O6#/\O6+224#>O3#/\(O3_2+224#>O6_2#/\O6_2+224#>O3_2)#=>max(max(O3,O6)-min(O3,O6),max(O3+224,O6+224)-min(O3+224,O6+224))#=<10#/\max(max(O3_2,O6_2)-min(O3_2,O6_2),max(O3_2+224,O6_2+224)-min(O3_2+224,O6_2+224))#=<10,
	O3+224#>O7#/\O7+224#>O3#/\(O3_2+224#>O7_2#/\O7_2+224#>O3_2)#=>max(max(O3,O7)-min(O3,O7),max(O3+224,O7+224)-min(O3+224,O7+224))#=<10#/\max(max(O3_2,O7_2)-min(O3_2,O7_2),max(O3_2+224,O7_2+224)-min(O3_2+224,O7_2+224))#=<10,
	O3+224#>O8#/\O8+224#>O3#/\(O3_2+224#>O8_2#/\O8_2+224#>O3_2)#=>max(max(O3,O8)-min(O3,O8),max(O3+224,O8+224)-min(O3+224,O8+224))#=<10#/\max(max(O3_2,O8_2)-min(O3_2,O8_2),max(O3_2+224,O8_2+224)-min(O3_2+224,O8_2+224))#=<10,
	O3+224#>O9#/\O9+155#>O3#/\(O3_2+224#>O9_2#/\O9_2+224#>O3_2)#=>max(max(O3,O9)-min(O3,O9),max(O3+224,O9+155)-min(O3+224,O9+155))#=<10#/\max(max(O3_2,O9_2)-min(O3_2,O9_2),max(O3_2+224,O9_2+224)-min(O3_2+224,O9_2+224))#=<10,
	O3+224#>O10#/\O10+112#>O3#/\(O3_2+224#>O10_2#/\O10_2+224#>O3_2)#=>max(max(O3,O10)-min(O3,O10),max(O3+224,O10+112)-min(O3+224,O10+112))#=<10#/\max(max(O3_2,O10_2)-min(O3_2,O10_2),max(O3_2+224,O10_2+224)-min(O3_2+224,O10_2+224))#=<10,
	O4+224#>O2#/\O2+224#>O4#/\(O4_2+224#>O2_2#/\O2_2+224#>O4_2)#=>max(max(O4,O2)-min(O4,O2),max(O4+224,O2+224)-min(O4+224,O2+224))#=<10#/\max(max(O4_2,O2_2)-min(O4_2,O2_2),max(O4_2+224,O2_2+224)-min(O4_2+224,O2_2+224))#=<10,
	O4+224#>O3#/\O3+224#>O4#/\(O4_2+224#>O3_2#/\O3_2+224#>O4_2)#=>max(max(O4,O3)-min(O4,O3),max(O4+224,O3+224)-min(O4+224,O3+224))#=<10#/\max(max(O4_2,O3_2)-min(O4_2,O3_2),max(O4_2+224,O3_2+224)-min(O4_2+224,O3_2+224))#=<10,
	O4+224#>O5#/\O5+224#>O4#/\(O4_2+224#>O5_2#/\O5_2+224#>O4_2)#=>max(max(O4,O5)-min(O4,O5),max(O4+224,O5+224)-min(O4+224,O5+224))#=<10#/\max(max(O4_2,O5_2)-min(O4_2,O5_2),max(O4_2+224,O5_2+224)-min(O4_2+224,O5_2+224))#=<10,
	O4+224#>O6#/\O6+224#>O4#/\(O4_2+224#>O6_2#/\O6_2+224#>O4_2)#=>max(max(O4,O6)-min(O4,O6),max(O4+224,O6+224)-min(O4+224,O6+224))#=<10#/\max(max(O4_2,O6_2)-min(O4_2,O6_2),max(O4_2+224,O6_2+224)-min(O4_2+224,O6_2+224))#=<10,
	O4+224#>O7#/\O7+224#>O4#/\(O4_2+224#>O7_2#/\O7_2+224#>O4_2)#=>max(max(O4,O7)-min(O4,O7),max(O4+224,O7+224)-min(O4+224,O7+224))#=<10#/\max(max(O4_2,O7_2)-min(O4_2,O7_2),max(O4_2+224,O7_2+224)-min(O4_2+224,O7_2+224))#=<10,
	O4+224#>O8#/\O8+224#>O4#/\(O4_2+224#>O8_2#/\O8_2+224#>O4_2)#=>max(max(O4,O8)-min(O4,O8),max(O4+224,O8+224)-min(O4+224,O8+224))#=<10#/\max(max(O4_2,O8_2)-min(O4_2,O8_2),max(O4_2+224,O8_2+224)-min(O4_2+224,O8_2+224))#=<10,
	O4+224#>O9#/\O9+155#>O4#/\(O4_2+224#>O9_2#/\O9_2+224#>O4_2)#=>max(max(O4,O9)-min(O4,O9),max(O4+224,O9+155)-min(O4+224,O9+155))#=<10#/\max(max(O4_2,O9_2)-min(O4_2,O9_2),max(O4_2+224,O9_2+224)-min(O4_2+224,O9_2+224))#=<10,
	O4+224#>O10#/\O10+112#>O4#/\(O4_2+224#>O10_2#/\O10_2+224#>O4_2)#=>max(max(O4,O10)-min(O4,O10),max(O4+224,O10+112)-min(O4+224,O10+112))#=<10#/\max(max(O4_2,O10_2)-min(O4_2,O10_2),max(O4_2+224,O10_2+224)-min(O4_2+224,O10_2+224))#=<10,
	O5+224#>O2#/\O2+224#>O5#/\(O5_2+224#>O2_2#/\O2_2+224#>O5_2)#=>max(max(O5,O2)-min(O5,O2),max(O5+224,O2+224)-min(O5+224,O2+224))#=<10#/\max(max(O5_2,O2_2)-min(O5_2,O2_2),max(O5_2+224,O2_2+224)-min(O5_2+224,O2_2+224))#=<10,
	O5+224#>O3#/\O3+224#>O5#/\(O5_2+224#>O3_2#/\O3_2+224#>O5_2)#=>max(max(O5,O3)-min(O5,O3),max(O5+224,O3+224)-min(O5+224,O3+224))#=<10#/\max(max(O5_2,O3_2)-min(O5_2,O3_2),max(O5_2+224,O3_2+224)-min(O5_2+224,O3_2+224))#=<10,
	O5+224#>O4#/\O4+224#>O5#/\(O5_2+224#>O4_2#/\O4_2+224#>O5_2)#=>max(max(O5,O4)-min(O5,O4),max(O5+224,O4+224)-min(O5+224,O4+224))#=<10#/\max(max(O5_2,O4_2)-min(O5_2,O4_2),max(O5_2+224,O4_2+224)-min(O5_2+224,O4_2+224))#=<10,
	O5+224#>O6#/\O6+224#>O5#/\(O5_2+224#>O6_2#/\O6_2+224#>O5_2)#=>max(max(O5,O6)-min(O5,O6),max(O5+224,O6+224)-min(O5+224,O6+224))#=<10#/\max(max(O5_2,O6_2)-min(O5_2,O6_2),max(O5_2+224,O6_2+224)-min(O5_2+224,O6_2+224))#=<10,
	O5+224#>O7#/\O7+224#>O5#/\(O5_2+224#>O7_2#/\O7_2+224#>O5_2)#=>max(max(O5,O7)-min(O5,O7),max(O5+224,O7+224)-min(O5+224,O7+224))#=<10#/\max(max(O5_2,O7_2)-min(O5_2,O7_2),max(O5_2+224,O7_2+224)-min(O5_2+224,O7_2+224))#=<10,
	O5+224#>O8#/\O8+224#>O5#/\(O5_2+224#>O8_2#/\O8_2+224#>O5_2)#=>max(max(O5,O8)-min(O5,O8),max(O5+224,O8+224)-min(O5+224,O8+224))#=<10#/\max(max(O5_2,O8_2)-min(O5_2,O8_2),max(O5_2+224,O8_2+224)-min(O5_2+224,O8_2+224))#=<10,
	O5+224#>O9#/\O9+155#>O5#/\(O5_2+224#>O9_2#/\O9_2+224#>O5_2)#=>max(max(O5,O9)-min(O5,O9),max(O5+224,O9+155)-min(O5+224,O9+155))#=<10#/\max(max(O5_2,O9_2)-min(O5_2,O9_2),max(O5_2+224,O9_2+224)-min(O5_2+224,O9_2+224))#=<10,
	O5+224#>O10#/\O10+112#>O5#/\(O5_2+224#>O10_2#/\O10_2+224#>O5_2)#=>max(max(O5,O10)-min(O5,O10),max(O5+224,O10+112)-min(O5+224,O10+112))#=<10#/\max(max(O5_2,O10_2)-min(O5_2,O10_2),max(O5_2+224,O10_2+224)-min(O5_2+224,O10_2+224))#=<10,
	O6+224#>O2#/\O2+224#>O6#/\(O6_2+224#>O2_2#/\O2_2+224#>O6_2)#=>max(max(O6,O2)-min(O6,O2),max(O6+224,O2+224)-min(O6+224,O2+224))#=<10#/\max(max(O6_2,O2_2)-min(O6_2,O2_2),max(O6_2+224,O2_2+224)-min(O6_2+224,O2_2+224))#=<10,
	O6+224#>O3#/\O3+224#>O6#/\(O6_2+224#>O3_2#/\O3_2+224#>O6_2)#=>max(max(O6,O3)-min(O6,O3),max(O6+224,O3+224)-min(O6+224,O3+224))#=<10#/\max(max(O6_2,O3_2)-min(O6_2,O3_2),max(O6_2+224,O3_2+224)-min(O6_2+224,O3_2+224))#=<10,
	O6+224#>O4#/\O4+224#>O6#/\(O6_2+224#>O4_2#/\O4_2+224#>O6_2)#=>max(max(O6,O4)-min(O6,O4),max(O6+224,O4+224)-min(O6+224,O4+224))#=<10#/\max(max(O6_2,O4_2)-min(O6_2,O4_2),max(O6_2+224,O4_2+224)-min(O6_2+224,O4_2+224))#=<10,
	O6+224#>O5#/\O5+224#>O6#/\(O6_2+224#>O5_2#/\O5_2+224#>O6_2)#=>max(max(O6,O5)-min(O6,O5),max(O6+224,O5+224)-min(O6+224,O5+224))#=<10#/\max(max(O6_2,O5_2)-min(O6_2,O5_2),max(O6_2+224,O5_2+224)-min(O6_2+224,O5_2+224))#=<10,
	O6+224#>O7#/\O7+224#>O6#/\(O6_2+224#>O7_2#/\O7_2+224#>O6_2)#=>max(max(O6,O7)-min(O6,O7),max(O6+224,O7+224)-min(O6+224,O7+224))#=<10#/\max(max(O6_2,O7_2)-min(O6_2,O7_2),max(O6_2+224,O7_2+224)-min(O6_2+224,O7_2+224))#=<10,
	O6+224#>O8#/\O8+224#>O6#/\(O6_2+224#>O8_2#/\O8_2+224#>O6_2)#=>max(max(O6,O8)-min(O6,O8),max(O6+224,O8+224)-min(O6+224,O8+224))#=<10#/\max(max(O6_2,O8_2)-min(O6_2,O8_2),max(O6_2+224,O8_2+224)-min(O6_2+224,O8_2+224))#=<10,
	O6+224#>O9#/\O9+155#>O6#/\(O6_2+224#>O9_2#/\O9_2+224#>O6_2)#=>max(max(O6,O9)-min(O6,O9),max(O6+224,O9+155)-min(O6+224,O9+155))#=<10#/\max(max(O6_2,O9_2)-min(O6_2,O9_2),max(O6_2+224,O9_2+224)-min(O6_2+224,O9_2+224))#=<10,
	O6+224#>O10#/\O10+112#>O6#/\(O6_2+224#>O10_2#/\O10_2+224#>O6_2)#=>max(max(O6,O10)-min(O6,O10),max(O6+224,O10+112)-min(O6+224,O10+112))#=<10#/\max(max(O6_2,O10_2)-min(O6_2,O10_2),max(O6_2+224,O10_2+224)-min(O6_2+224,O10_2+224))#=<10,
	O7+224#>O2#/\O2+224#>O7#/\(O7_2+224#>O2_2#/\O2_2+224#>O7_2)#=>max(max(O7,O2)-min(O7,O2),max(O7+224,O2+224)-min(O7+224,O2+224))#=<10#/\max(max(O7_2,O2_2)-min(O7_2,O2_2),max(O7_2+224,O2_2+224)-min(O7_2+224,O2_2+224))#=<10,
	O7+224#>O3#/\O3+224#>O7#/\(O7_2+224#>O3_2#/\O3_2+224#>O7_2)#=>max(max(O7,O3)-min(O7,O3),max(O7+224,O3+224)-min(O7+224,O3+224))#=<10#/\max(max(O7_2,O3_2)-min(O7_2,O3_2),max(O7_2+224,O3_2+224)-min(O7_2+224,O3_2+224))#=<10,
	O7+224#>O4#/\O4+224#>O7#/\(O7_2+224#>O4_2#/\O4_2+224#>O7_2)#=>max(max(O7,O4)-min(O7,O4),max(O7+224,O4+224)-min(O7+224,O4+224))#=<10#/\max(max(O7_2,O4_2)-min(O7_2,O4_2),max(O7_2+224,O4_2+224)-min(O7_2+224,O4_2+224))#=<10,
	O7+224#>O5#/\O5+224#>O7#/\(O7_2+224#>O5_2#/\O5_2+224#>O7_2)#=>max(max(O7,O5)-min(O7,O5),max(O7+224,O5+224)-min(O7+224,O5+224))#=<10#/\max(max(O7_2,O5_2)-min(O7_2,O5_2),max(O7_2+224,O5_2+224)-min(O7_2+224,O5_2+224))#=<10,
	O7+224#>O6#/\O6+224#>O7#/\(O7_2+224#>O6_2#/\O6_2+224#>O7_2)#=>max(max(O7,O6)-min(O7,O6),max(O7+224,O6+224)-min(O7+224,O6+224))#=<10#/\max(max(O7_2,O6_2)-min(O7_2,O6_2),max(O7_2+224,O6_2+224)-min(O7_2+224,O6_2+224))#=<10,
	O7+224#>O8#/\O8+224#>O7#/\(O7_2+224#>O8_2#/\O8_2+224#>O7_2)#=>max(max(O7,O8)-min(O7,O8),max(O7+224,O8+224)-min(O7+224,O8+224))#=<10#/\max(max(O7_2,O8_2)-min(O7_2,O8_2),max(O7_2+224,O8_2+224)-min(O7_2+224,O8_2+224))#=<10,
	O7+224#>O9#/\O9+155#>O7#/\(O7_2+224#>O9_2#/\O9_2+224#>O7_2)#=>max(max(O7,O9)-min(O7,O9),max(O7+224,O9+155)-min(O7+224,O9+155))#=<10#/\max(max(O7_2,O9_2)-min(O7_2,O9_2),max(O7_2+224,O9_2+224)-min(O7_2+224,O9_2+224))#=<10,
	O7+224#>O10#/\O10+112#>O7#/\(O7_2+224#>O10_2#/\O10_2+224#>O7_2)#=>max(max(O7,O10)-min(O7,O10),max(O7+224,O10+112)-min(O7+224,O10+112))#=<10#/\max(max(O7_2,O10_2)-min(O7_2,O10_2),max(O7_2+224,O10_2+224)-min(O7_2+224,O10_2+224))#=<10,
	O8+224#>O2#/\O2+224#>O8#/\(O8_2+224#>O2_2#/\O2_2+224#>O8_2)#=>max(max(O8,O2)-min(O8,O2),max(O8+224,O2+224)-min(O8+224,O2+224))#=<10#/\max(max(O8_2,O2_2)-min(O8_2,O2_2),max(O8_2+224,O2_2+224)-min(O8_2+224,O2_2+224))#=<10,
	O8+224#>O3#/\O3+224#>O8#/\(O8_2+224#>O3_2#/\O3_2+224#>O8_2)#=>max(max(O8,O3)-min(O8,O3),max(O8+224,O3+224)-min(O8+224,O3+224))#=<10#/\max(max(O8_2,O3_2)-min(O8_2,O3_2),max(O8_2+224,O3_2+224)-min(O8_2+224,O3_2+224))#=<10,
	O8+224#>O4#/\O4+224#>O8#/\(O8_2+224#>O4_2#/\O4_2+224#>O8_2)#=>max(max(O8,O4)-min(O8,O4),max(O8+224,O4+224)-min(O8+224,O4+224))#=<10#/\max(max(O8_2,O4_2)-min(O8_2,O4_2),max(O8_2+224,O4_2+224)-min(O8_2+224,O4_2+224))#=<10,
	O8+224#>O5#/\O5+224#>O8#/\(O8_2+224#>O5_2#/\O5_2+224#>O8_2)#=>max(max(O8,O5)-min(O8,O5),max(O8+224,O5+224)-min(O8+224,O5+224))#=<10#/\max(max(O8_2,O5_2)-min(O8_2,O5_2),max(O8_2+224,O5_2+224)-min(O8_2+224,O5_2+224))#=<10,
	O8+224#>O6#/\O6+224#>O8#/\(O8_2+224#>O6_2#/\O6_2+224#>O8_2)#=>max(max(O8,O6)-min(O8,O6),max(O8+224,O6+224)-min(O8+224,O6+224))#=<10#/\max(max(O8_2,O6_2)-min(O8_2,O6_2),max(O8_2+224,O6_2+224)-min(O8_2+224,O6_2+224))#=<10,
	O8+224#>O7#/\O7+224#>O8#/\(O8_2+224#>O7_2#/\O7_2+224#>O8_2)#=>max(max(O8,O7)-min(O8,O7),max(O8+224,O7+224)-min(O8+224,O7+224))#=<10#/\max(max(O8_2,O7_2)-min(O8_2,O7_2),max(O8_2+224,O7_2+224)-min(O8_2+224,O7_2+224))#=<10,
	O8+224#>O9#/\O9+155#>O8#/\(O8_2+224#>O9_2#/\O9_2+224#>O8_2)#=>max(max(O8,O9)-min(O8,O9),max(O8+224,O9+155)-min(O8+224,O9+155))#=<10#/\max(max(O8_2,O9_2)-min(O8_2,O9_2),max(O8_2+224,O9_2+224)-min(O8_2+224,O9_2+224))#=<10,
	O8+224#>O10#/\O10+112#>O8#/\(O8_2+224#>O10_2#/\O10_2+224#>O8_2)#=>max(max(O8,O10)-min(O8,O10),max(O8+224,O10+112)-min(O8+224,O10+112))#=<10#/\max(max(O8_2,O10_2)-min(O8_2,O10_2),max(O8_2+224,O10_2+224)-min(O8_2+224,O10_2+224))#=<10,
	O9+155#>O2#/\O2+224#>O9#/\(O9_2+224#>O2_2#/\O2_2+224#>O9_2)#=>max(max(O9,O2)-min(O9,O2),max(O9+155,O2+224)-min(O9+155,O2+224))#=<10#/\max(max(O9_2,O2_2)-min(O9_2,O2_2),max(O9_2+224,O2_2+224)-min(O9_2+224,O2_2+224))#=<10,
	O9+155#>O3#/\O3+224#>O9#/\(O9_2+224#>O3_2#/\O3_2+224#>O9_2)#=>max(max(O9,O3)-min(O9,O3),max(O9+155,O3+224)-min(O9+155,O3+224))#=<10#/\max(max(O9_2,O3_2)-min(O9_2,O3_2),max(O9_2+224,O3_2+224)-min(O9_2+224,O3_2+224))#=<10,
	O9+155#>O4#/\O4+224#>O9#/\(O9_2+224#>O4_2#/\O4_2+224#>O9_2)#=>max(max(O9,O4)-min(O9,O4),max(O9+155,O4+224)-min(O9+155,O4+224))#=<10#/\max(max(O9_2,O4_2)-min(O9_2,O4_2),max(O9_2+224,O4_2+224)-min(O9_2+224,O4_2+224))#=<10,
	O9+155#>O5#/\O5+224#>O9#/\(O9_2+224#>O5_2#/\O5_2+224#>O9_2)#=>max(max(O9,O5)-min(O9,O5),max(O9+155,O5+224)-min(O9+155,O5+224))#=<10#/\max(max(O9_2,O5_2)-min(O9_2,O5_2),max(O9_2+224,O5_2+224)-min(O9_2+224,O5_2+224))#=<10,
	O9+155#>O6#/\O6+224#>O9#/\(O9_2+224#>O6_2#/\O6_2+224#>O9_2)#=>max(max(O9,O6)-min(O9,O6),max(O9+155,O6+224)-min(O9+155,O6+224))#=<10#/\max(max(O9_2,O6_2)-min(O9_2,O6_2),max(O9_2+224,O6_2+224)-min(O9_2+224,O6_2+224))#=<10,
	O9+155#>O7#/\O7+224#>O9#/\(O9_2+224#>O7_2#/\O7_2+224#>O9_2)#=>max(max(O9,O7)-min(O9,O7),max(O9+155,O7+224)-min(O9+155,O7+224))#=<10#/\max(max(O9_2,O7_2)-min(O9_2,O7_2),max(O9_2+224,O7_2+224)-min(O9_2+224,O7_2+224))#=<10,
	O9+155#>O8#/\O8+224#>O9#/\(O9_2+224#>O8_2#/\O8_2+224#>O9_2)#=>max(max(O9,O8)-min(O9,O8),max(O9+155,O8+224)-min(O9+155,O8+224))#=<10#/\max(max(O9_2,O8_2)-min(O9_2,O8_2),max(O9_2+224,O8_2+224)-min(O9_2+224,O8_2+224))#=<10,
	O9+155#>O10#/\O10+112#>O9#/\(O9_2+224#>O10_2#/\O10_2+224#>O9_2)#=>max(max(O9,O10)-min(O9,O10),max(O9+155,O10+112)-min(O9+155,O10+112))#=<10#/\max(max(O9_2,O10_2)-min(O9_2,O10_2),max(O9_2+224,O10_2+224)-min(O9_2+224,O10_2+224))#=<10,
	O10+112#>O2#/\O2+224#>O10#/\(O10_2+224#>O2_2#/\O2_2+224#>O10_2)#=>max(max(O10,O2)-min(O10,O2),max(O10+112,O2+224)-min(O10+112,O2+224))#=<10#/\max(max(O10_2,O2_2)-min(O10_2,O2_2),max(O10_2+224,O2_2+224)-min(O10_2+224,O2_2+224))#=<10,
	O10+112#>O3#/\O3+224#>O10#/\(O10_2+224#>O3_2#/\O3_2+224#>O10_2)#=>max(max(O10,O3)-min(O10,O3),max(O10+112,O3+224)-min(O10+112,O3+224))#=<10#/\max(max(O10_2,O3_2)-min(O10_2,O3_2),max(O10_2+224,O3_2+224)-min(O10_2+224,O3_2+224))#=<10,
	O10+112#>O4#/\O4+224#>O10#/\(O10_2+224#>O4_2#/\O4_2+224#>O10_2)#=>max(max(O10,O4)-min(O10,O4),max(O10+112,O4+224)-min(O10+112,O4+224))#=<10#/\max(max(O10_2,O4_2)-min(O10_2,O4_2),max(O10_2+224,O4_2+224)-min(O10_2+224,O4_2+224))#=<10,
	O10+112#>O5#/\O5+224#>O10#/\(O10_2+224#>O5_2#/\O5_2+224#>O10_2)#=>max(max(O10,O5)-min(O10,O5),max(O10+112,O5+224)-min(O10+112,O5+224))#=<10#/\max(max(O10_2,O5_2)-min(O10_2,O5_2),max(O10_2+224,O5_2+224)-min(O10_2+224,O5_2+224))#=<10,
	O10+112#>O6#/\O6+224#>O10#/\(O10_2+224#>O6_2#/\O6_2+224#>O10_2)#=>max(max(O10,O6)-min(O10,O6),max(O10+112,O6+224)-min(O10+112,O6+224))#=<10#/\max(max(O10_2,O6_2)-min(O10_2,O6_2),max(O10_2+224,O6_2+224)-min(O10_2+224,O6_2+224))#=<10,
	O10+112#>O7#/\O7+224#>O10#/\(O10_2+224#>O7_2#/\O7_2+224#>O10_2)#=>max(max(O10,O7)-min(O10,O7),max(O10+112,O7+224)-min(O10+112,O7+224))#=<10#/\max(max(O10_2,O7_2)-min(O10_2,O7_2),max(O10_2+224,O7_2+224)-min(O10_2+224,O7_2+224))#=<10,
	O10+112#>O8#/\O8+224#>O10#/\(O10_2+224#>O8_2#/\O8_2+224#>O10_2)#=>max(max(O10,O8)-min(O10,O8),max(O10+112,O8+224)-min(O10+112,O8+224))#=<10#/\max(max(O10_2,O8_2)-min(O10_2,O8_2),max(O10_2+224,O8_2+224)-min(O10_2+224,O8_2+224))#=<10,
	O10+112#>O9#/\O9+155#>O10#/\(O10_2+224#>O9_2#/\O9_2+224#>O10_2)#=>max(max(O10,O9)-min(O10,O9),max(O10+112,O9+155)-min(O10+112,O9+155))#=<10#/\max(max(O10_2,O9_2)-min(O10_2,O9_2),max(O10_2+224,O9_2+224)-min(O10_2+224,O9_2+224))#=<10,
	0#=<O2,
	O2+224#=<1203,
	0#=<O2_2,
	O2_2+224#=<235,
	0#=<O2_3,
	O2_3+111#=<239,
	0#=<O3,
	O3+224#=<1203,
	0#=<O3_2,
	O3_2+224#=<235,
	0#=<O3_3,
	O3_3+74#=<239,
	0#=<O4,
	O4+224#=<1203,
	0#=<O4_2,
	O4_2+224#=<235,
	0#=<O4_3,
	O4_3+74#=<239,
	0#=<O5,
	O5+224#=<1203,
	0#=<O5_2,
	O5_2+224#=<235,
	0#=<O5_3,
	O5_3+148#=<239,
	0#=<O6,
	O6+224#=<1203,
	0#=<O6_2,
	O6_2+224#=<235,
	0#=<O6_3,
	O6_3+111#=<239,
	0#=<O7,
	O7+224#=<1203,
	0#=<O7_2,
	O7_2+224#=<235,
	0#=<O7_3,
	O7_3+111#=<239,
	0#=<O8,
	O8+224#=<1203,
	0#=<O8_2,
	O8_2+224#=<235,
	0#=<O8_3,
	O8_3+222#=<239,
	0#=<O9,
	O9+155#=<1203,
	0#=<O9_2,
	O9_2+224#=<235,
	0#=<O9_3,
	O9_3+222#=<239,
	0#=<O10,
	O10+112#=<1203,
	0#=<O10_2,
	O10_2+224#=<235,
	0#=<O10_3,
	O10_3+148#=<239,
	geost([object(8,7,[O2,O2_2,O2_3],[]),object(12,11,[O3,O3_2,O3_3],[]),object(13,11,[O4,O4_2,O4_3],[]),object(17,16,[O5,O5_2,O5_3],[]),object(18,7,[O6,O6_2,O6_3],[]),object(19,7,[O7,O7_2,O7_3],[]),object(23,22,[O8,O8_2,O8_3],[]),object(27,26,[O9,O9_2,O9_3],[]),object(31,30,[O10,O10_2,O10_3],[])], [sbox(7,[0,0,0],[224,224,111]),sbox(11,[0,0,0],[224,224,74]),sbox(16,[0,0,0],[224,224,148]),sbox(22,[0,0,0],[224,224,222]),sbox(26,[0,0,0],[155,224,222]),sbox(30,[0,0,0],[112,224,148])], [non_overlapping(objects([8,12,13,17,18,19,23,27,31]),[1,2,3])]),
	labeling([up], [O4_3]),
	labeling([bisect], [O4,O4_2]),
	labeling([up], [O8_3]),
	labeling([bisect], [O8,O8_2]),
	labeling([up], [O3_3]),
	labeling([bisect], [O3,O3_2]),
	labeling([up], [O9_3]),
	labeling([bisect], [O9,O9_2]),
	labeling([up], [O5_3]),
	labeling([bisect], [O5,O5_2]),
	labeling([up], [O2_3]),
	labeling([bisect], [O2,O2_2]),
	labeling([up], [O10_3]),
	labeling([bisect], [O10,O10_2]),
	labeling([up], [O7_3]),
	labeling([bisect], [O7,O7_2]),
	labeling([up], [O6_3]),
	labeling([bisect], [O6,O6_2]).
