# NOTE: This code has been generated using the assumption that we
# first compare pairwise all variables, which in this case requires
# performing 7 comparisons.  Gasarch et al. conjecture that this
# should not lead to suboptimal selection algorithms.  In this
# particular case (N=15, I=3) the found algorithm's complexity
# coincides with the best known theoretical result, and we can hence
# deduce that this algorithm is optimal.

# cost = 13
# n_nodes = 593195
# version = 1.1
# time = 4727.520
# hash_table_size = 2038897
# n_solved = 168
# n_unsolved = 120237
# n_hits = 34900779
# n_misses = 120405
# n_stores = 120405
# avg_priority = 3972.946
# avg_cost = 4.927

# n=15, i=3, cost=13: a>i,b>m,c>k,d>o,e>j,f>l,g>n
find_1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if a > b
  then find_2(a,c,d,e,f,g,b,h,i,k,j,l,n,o,m)
  else find_3(b,c,d,e,f,g,a,h,m,k,l,j,n,o,i)
# n=15, i=3, cost=12: a>g,a>i,a>o,b>j,c>n,d>l,e>k,f>m,g>o
find_3(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if a > b
  then find_4(a,c,d,e,f,b,g,h,i,l,m,k,n,j,o)
  else find_5(b,a,c,d,e,f,h,j,n,l,m,k,i,g)
# n=14, i=3, cost=11: a>b,a>h,a>m,a>n,b>m,b>n,c>i,d>j,e>l,f>k
find_5(a,b,c,d,e,f,g,h,i,j,k,l,m,n) =
  if a > c
  then find_6(a,b,d,e,f,c,g,h,j,k,l,m,n,i)
  else find_7(c,a,d,e,f,g,i,j,k,l,b,h)
# n=12, i=3, cost=9: a>b,a>g,a>k,a>l,b>k,b>l,c>h,d>j,e>i
find_7(a,b,c,d,e,f,g,h,i,j,k,l) =
  if c > d
  then find_8(a,c,b,e,d,f,g,h,i,k,l,j)
  else find_8(a,d,b,e,c,f,g,j,i,k,l,h)
# n=12, i=3, cost=8: a>c,a>g,a>j,a>k,b>e,b>h,b>l,c>j,c>k,d>i,e>l
find_8(a,b,c,d,e,f,g,h,i,j,k,l) =
  if a > b
  then find_9(a,b,c,d,f,g,i,h,e,j,k)
  else find_10(b,a,d,e,f,h,i,c,g,l)
# n=10, i=3, cost=7: a>b,a>d,a>f,a>h,a>i,a>j,b>h,b>i,c>g,d>j
find_10(a,b,c,d,e,f,g,h,i,j) =
  if b > c
  then find_11(b,d,e,f,c,h,i,j)
  else find_12(a,c,d,e,f,g,b,j)
# n=8, i=3, cost=6: a>c,a>e,a>g,a>h,b>f,b>g,c>h
find_12(a,b,c,d,e,f,g,h) =
  if a > b
  then find_13(b,c,d,e,f,g,h)
  else find_14(a,d,f,e,c,g)
# n=6, i=2, cost=5: a>d,a>e,a>f
find_14(a,b,c,d,e,f) =
  if b > c
  then find_15(a,b,d,e,f,c)
  else find_15(a,c,d,e,f,b)
# n=6, i=2, cost=4: a>c,a>d,a>e,b>f
find_15(a,b,c,d,e,f) =
  if a > b
  then find_16(b,c,d,e)
  else find_17(a,f)
# n=2, i=1, cost=1: no comparisons done
find_17(a,b) =
  if a > b
  then a
  else b
# n=4, i=1, cost=3: no comparisons done
find_16(a,b,c,d) =
  if a > b
  then find_18(a,c,d)
  else find_18(b,c,d)
# n=3, i=1, cost=2: no comparisons done
find_18(a,b,c) =
  if a > b
  then find_17(a,c)
  else find_17(b,c)
# n=7, i=2, cost=5: a>e,a>f,b>g
find_13(a,b,c,d,e,f,g) =
  if c > d
  then find_19(a,b,c,e,f,d,g)
  else find_19(a,b,d,e,f,c,g)
# n=7, i=2, cost=4: a>d,a>e,b>g,c>f
find_19(a,b,c,d,e,f,g) =
  if b > c
  then find_20(a,b,d,e,c,g)
  else find_20(a,c,d,e,b,f)
# n=6, i=2, cost=3: a>c,a>d,b>e,b>f
find_20(a,b,c,d,e,f) =
  if a > b
  then find_18(b,c,d)
  else find_18(a,e,f)
# n=8, i=2, cost=6: a>e,a>f,a>g,b>h
find_11(a,b,c,d,e,f,g,h) =
  if b > c
  then find_21(a,b,d,e,f,g,c,h)
  else find_22(a,c,d,e,f,g,b)
# n=7, i=2, cost=5: a>d,a>e,a>f,b>g
find_22(a,b,c,d,e,f,g) =
  if b > c
  then find_23(a,b,d,e,f,c,g)
  else find_15(a,c,d,e,f,b)
# n=7, i=2, cost=4: a>c,a>d,a>e,b>f,b>g
find_23(a,b,c,d,e,f,g) =
  if a > b
  then find_16(b,c,d,e)
  else find_18(a,f,g)
# n=8, i=2, cost=5: a>d,a>e,a>f,b>g,b>h
find_21(a,b,c,d,e,f,g,h) =
  if b > c
  then find_24(a,b,d,e,f,c,g,h)
  else find_15(a,c,d,e,f,b)
# n=8, i=2, cost=4: a>c,a>d,a>e,b>f,b>g,b>h
find_24(a,b,c,d,e,f,g,h) =
  if a > b
  then find_16(b,c,d,e)
  else find_16(a,f,g,h)
# n=11, i=3, cost=7: a>b,a>c,a>f,a>h,a>i,a>j,a>k,b>h,b>i,c>j,c>k,d>g
find_9(a,b,c,d,e,f,g,h,i,j,k) =
  if b > c
  then find_25(a,b,d,e,f,g,c,h,i)
  else find_25(a,c,d,e,f,g,b,j,k)
# n=9, i=3, cost=6: a>b,a>e,a>g,a>h,a>i,b>g,b>h,b>i,c>f
find_25(a,b,c,d,e,f,g,h,i) =
  if d > e
  then find_26(a,b,d,c,f,g,h,i,e)
  else find_27(a,b,c,e,f,g,h,i,d)
# n=9, i=3, cost=5: a>b,a>d,a>f,a>g,a>h,a>i,b>f,b>g,b>h,c>e,d>i
find_27(a,b,c,d,e,f,g,h,i) =
  if c > d
  then find_28(a,b,c,e,f,g,h,d)
  else find_23(b,d,f,g,h,c,i)
# n=8, i=3, cost=4: a>b,a>e,a>f,a>g,a>h,b>e,b>f,b>g,c>d,c>h
find_28(a,b,c,d,e,f,g,h) =
  if b > c
  then find_16(c,e,f,g)
  else find_29(a,d,b,h)
# n=4, i=2, cost=3: a>c,a>d
find_29(a,b,c,d) =
  if a > b
  then find_18(b,c,d)
  else a
# n=9, i=3, cost=5: a>b,a>f,a>g,a>h,a>i,b>f,b>g,b>h,c>i,d>e
find_26(a,b,c,d,e,f,g,h,i) =
  if c > d
  then find_30(a,c,b,d,f,g,h,i,e)
  else find_31(a,b,d,c,e,f,g,h)
# n=8, i=3, cost=4: a>b,a>f,a>g,a>h,b>f,b>g,b>h,c>d,c>e
find_31(a,b,c,d,e,f,g,h) =
  if b > c
  then find_16(c,f,g,h)
  else find_32(a,d,e,b)
# n=4, i=2, cost=3: a>d
find_32(a,b,c,d) =
  if b > c
  then find_33(a,b,d,c)
  else find_33(a,c,d,b)
# n=4, i=2, cost=2: a>c,b>d
find_33(a,b,c,d) =
  if a > b
  then find_17(b,c)
  else find_17(a,d)
# n=9, i=3, cost=4: a>c,a>e,a>f,a>g,a>h,b>d,b>h,b>i,c>e,c>f,c>g,d>i
find_30(a,b,c,d,e,f,g,h,i) =
  if b > c
  then find_34(a,d,c,h,i)
  else find_16(b,e,f,g)
# n=5, i=2, cost=3: a>c,a>d,b>e
find_34(a,b,c,d,e) =
  if a > b
  then find_18(b,c,d)
  else find_17(a,e)
# n=14, i=3, cost=10: a>b,a>f,a>h,a>l,a>m,a>n,b>l,b>m,c>i,d>k,e>j,f>n
find_6(a,b,c,d,e,f,g,h,i,j,k,l,m,n) =
  if b > g
  then find_35(a,b,c,d,e,f,h,i,j,k,n,l,m,g)
  else find_36(a,g,d,e,c,f,h,k,j,i,n,b)
# n=12, i=3, cost=9: a>f,a>g,a>k,a>l,b>l,c>h,d>i,e>j,f>k
find_36(a,b,c,d,e,f,g,h,i,j,k,l) =
  if b > c
  then find_37(a,b,d,e,f,c,g,i,j,l,k,h)
  else find_38(a,c,d,e,f,g,b,h,j,i,k)
# n=11, i=3, cost=8: a>e,a>f,a>k,b>g,b>h,c>j,d>i,e>k
find_38(a,b,c,d,e,f,g,h,i,j,k) =
  if c > d
  then find_39(a,c,b,e,d,f,j,h,g,k,i)
  else find_39(a,d,b,e,c,f,i,h,g,k,j)
# n=11, i=3, cost=7: a>d,a>f,a>j,b>e,b>g,b>k,c>h,c>i,d>j,e>k
find_39(a,b,c,d,e,f,g,h,i,j,k) =
  if a > b
  then find_40(a,c,b,d,f,h,i,e,g,j)
  else find_40(b,c,a,e,g,h,i,f,d,k)
# n=10, i=3, cost=6: a>c,a>d,a>e,a>h,a>i,a>j,b>f,b>g,c>h,c>i,d>j
find_40(a,b,c,d,e,f,g,h,i,j) =
  if d > e
  then find_41(a,b,c,d,f,g,e,j,h,i)
  else find_42(a,b,c,e,f,g,h,i,d)
# n=9, i=3, cost=5: a>c,a>d,a>g,a>h,a>i,b>e,b>f,c>g,c>h,d>i
find_42(a,b,c,d,e,f,g,h,i) =
  if b > c
  then find_43(a,b,d,e,f,c,i)
  else find_15(c,d,b,g,h,i)
# n=7, i=3, cost=4: a>c,a>f,a>g,b>d,b>e,b>f,c>g
find_43(a,b,c,d,e,f,g) =
  if c > d
  then find_44(a,b,c,e,f,g)
  else find_32(a,d,e,f)
# n=6, i=3, cost=3: a>c,a>e,a>f,b>d,b>e,c>f
find_44(a,b,c,d,e,f) =
  if c > d
  then find_33(b,c,e,f)
  else find_45(a,d,e)
# n=3, i=2, cost=2: a>c
find_45(a,b,c) =
  if a > b
  then find_17(b,c)
  else a
# n=10, i=3, cost=5: a>c,a>d,a>g,a>h,a>i,a>j,b>e,b>f,c>i,c>j,d>g,d>h
find_41(a,b,c,d,e,f,g,h,i,j) =
  if c > d
  then find_31(a,c,b,e,f,d,i,j)
  else find_31(a,d,b,e,f,c,g,h)
# n=12, i=3, cost=8: a>e,a>g,a>j,a>k,b>f,b>j,b>l,c>h,d>i,e>k,f>l
find_37(a,b,c,d,e,f,g,h,i,j,k,l) =
  if b > c
  then find_46(b,a,d,c,f,e,g,i,j,h,l,k)
  else find_47(a,c,d,e,b,g,h,i,k,f)
# n=10, i=3, cost=7: a>d,a>f,a>i,b>e,b>g,b>j,c>h,d>i,e>j
find_47(a,b,c,d,e,f,g,h,i,j) =
  if a > b
  then find_48(a,b,c,d,f,h,g,e,i)
  else find_48(b,a,c,e,g,h,d,f,j)
# n=9, i=3, cost=6: a>b,a>d,a>e,a>g,a>h,a>i,b>g,b>h,c>f,d>i
find_48(a,b,c,d,e,f,g,h,i) =
  if b > c
  then find_22(b,d,e,c,g,h,i)
  else find_49(a,c,d,e,f,b,i)
# n=7, i=3, cost=5: a>c,a>d,a>f,a>g,b>e,b>f,c>g
find_49(a,b,c,d,e,f,g) =
  if a > b
  then find_50(b,c,d,e,f,g)
  else find_51(a,e,d,c,f)
# n=5, i=2, cost=4: a>c,a>d,a>e
find_51(a,b,c,d,e) =
  if a > b
  then find_16(b,c,d,e)
  else a
# n=6, i=2, cost=4: a>d,a>e,b>f
find_50(a,b,c,d,e,f) =
  if b > c
  then find_20(a,b,d,e,c,f)
  else find_34(a,c,d,e,b)
# n=12, i=3, cost=7: a>d,a>e,a>i,a>j,a>k,b>f,b>g,b>i,b>l,c>h,d>j,e>k,f>l
find_46(a,b,c,d,e,f,g,h,i,j,k,l) =
  if a > b
  then find_52(a,b,c,d,e,h,g,f,i,k,j)
  else find_53(b,a,c,f,g,h,e,d,i,l)
# n=10, i=3, cost=6: a>b,a>d,a>e,a>g,a>h,a>i,a>j,b>g,b>h,b>i,c>f,d>j
find_53(a,b,c,d,e,f,g,h,i,j) =
  if d > e
  then find_54(a,b,d,c,f,g,h,i,e,j)
  else find_27(a,b,c,e,f,g,h,i,d)
# n=10, i=3, cost=5: a>b,a>c,a>f,a>g,a>h,a>i,a>j,b>f,b>g,b>h,c>i,c>j,d>e
find_54(a,b,c,d,e,f,g,h,i,j) =
  if c > d
  then find_24(b,c,f,g,h,d,i,j)
  else find_28(a,b,d,e,f,g,h,c)
# n=11, i=3, cost=6: a>b,a>d,a>e,a>g,a>h,a>i,a>j,a>k,b>g,b>h,b>i,c>f,d>k,e>j
find_52(a,b,c,d,e,f,g,h,i,j,k) =
  if d > e
  then find_54(a,b,d,c,f,g,h,i,e,k)
  else find_54(a,b,e,c,f,g,h,i,d,j)
# n=14, i=3, cost=9: a>b,a>f,a>g,a>k,a>l,a>m,a>n,b>l,b>m,b>n,c>h,d>j,e>i,f>k
find_35(a,b,c,d,e,f,g,h,i,j,k,l,m,n) =
  if b > c
  then find_55(a,b,d,e,f,g,j,i,c,l,m,n,k)
  else find_56(a,c,d,e,f,g,h,j,i,b,k)
# n=11, i=3, cost=8: a>e,a>f,a>j,a>k,b>g,b>j,c>h,d>i,e>k
find_56(a,b,c,d,e,f,g,h,i,j,k) =
  if b > c
  then find_57(a,b,d,e,c,f,g,i,j,k,h)
  else find_47(a,c,d,e,b,f,h,i,k,g)
# n=11, i=3, cost=7: a>d,a>f,a>i,a>j,b>e,b>g,b>i,b>k,c>h,d>j,e>k
find_57(a,b,c,d,e,f,g,h,i,j,k) =
  if a > b
  then find_53(a,b,c,d,f,h,g,e,i,j)
  else find_53(b,a,c,e,g,h,d,f,i,k)
# n=13, i=3, cost=8: a>b,a>e,a>f,a>i,a>j,a>k,a>l,a>m,b>i,b>j,b>k,b>l,c>g,d>h,e>m
find_55(a,b,c,d,e,f,g,h,i,j,k,l,m) =
  if c > d
  then find_58(a,b,c,e,d,f,g,i,j,k,l,m,h)
  else find_58(a,b,d,e,c,f,h,i,j,k,l,m,g)
# n=13, i=3, cost=7: a>b,a>d,a>f,a>h,a>i,a>j,a>k,a>l,b>h,b>i,b>j,b>k,c>e,c>g,c>m,d>l,e>m
find_58(a,b,c,d,e,f,g,h,i,j,k,l,m) =
  if d > f
  then find_59(a,b,c,d,e,g,h,i,j,k,f,l,m)
  else find_60(a,b,c,f,e,g,h,i,j,k,d,m)
# n=12, i=3, cost=6: a>b,a>d,a>g,a>h,a>i,a>j,a>k,b>g,b>h,b>i,b>j,c>e,c>f,c>l,d>k,e>l
find_60(a,b,c,d,e,f,g,h,i,j,k,l) =
  if c > d
  then find_61(a,c,b,e,f,g,h,i,j,d,l)
  else find_62(b,d,g,h,i,j,c,k)
# n=8, i=2, cost=5: a>c,a>d,a>e,a>f,b>g,b>h
find_62(a,b,c,d,e,f,g,h) =
  if a > b
  then find_63(b,c,d,e,f)
  else find_18(a,g,h)
# n=5, i=1, cost=4: no comparisons done
find_63(a,b,c,d,e) =
  if a > b
  then find_16(a,c,d,e)
  else find_16(b,c,d,e)
# n=11, i=3, cost=5: a>c,a>f,a>g,a>h,a>i,a>j,b>d,b>e,b>j,b>k,c>f,c>g,c>h,c>i,d>k
find_61(a,b,c,d,e,f,g,h,i,j,k) =
  if b > c
  then find_50(a,d,e,c,j,k)
  else find_63(b,f,g,h,i)
# n=13, i=3, cost=6: a>b,a>d,a>g,a>h,a>i,a>j,a>k,a>l,b>g,b>h,b>i,b>j,c>e,c>f,c>m,d>k,d>l,e>m
find_59(a,b,c,d,e,f,g,h,i,j,k,l,m) =
  if c > d
  then find_61(a,c,b,e,f,g,h,i,j,d,m)
  else find_64(b,d,g,h,i,j,c,k,l)
# n=9, i=2, cost=5: a>c,a>d,a>e,a>f,b>g,b>h,b>i
find_64(a,b,c,d,e,f,g,h,i) =
  if a > b
  then find_63(b,c,d,e,f)
  else find_16(a,g,h,i)
# n=15, i=3, cost=11: a>f,a>g,a>i,a>n,a>o,b>m,c>j,d>l,e>k,f>n,g>o
find_4(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if b > c
  then find_65(a,b,d,e,f,g,c,h,i,m,k,l,j,o,n)
  else find_65(a,c,d,e,f,g,b,h,i,j,k,l,m,o,n)
# n=15, i=3, cost=10: a>e,a>f,a>i,a>n,a>o,b>g,b>j,b>m,c>l,d>k,e>o,f>n,g>m
find_65(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if c > d
  then find_66(a,b,c,e,f,g,d,h,i,j,l,m,k,n,o)
  else find_66(a,b,d,e,f,g,c,h,i,j,k,m,l,n,o)
# n=15, i=3, cost=9: a>d,a>e,a>i,a>n,a>o,b>f,b>j,b>l,c>g,c>k,c>m,d>o,e>n,f>l,g>m
find_66(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if b > c
  then find_67(b,a,c,f,e,d,h,j,i,g,k,n,l,o)
  else find_67(c,a,b,g,e,d,h,k,i,j,f,n,m,o)
# n=14, i=3, cost=8: a>c,a>d,a>h,a>j,a>k,a>m,b>e,b>f,b>i,b>l,b>n,c>j,c>k,d>m,e>l,f>n
find_67(a,b,c,d,e,f,g,h,i,j,k,l,m,n) =
  if a > b
  then find_68(b,c,d,g,h,e,f,i,j,k,m)
  else find_69(a,e,f,g,i,c,h,d,l,n)
# n=10, i=2, cost=7: a>f,a>g,a>h,b>i,c>j
find_69(a,b,c,d,e,f,g,h,i,j) =
  if b > c
  then find_70(a,b,d,e,f,g,h,c,i)
  else find_70(a,c,d,e,f,g,h,b,j)
# n=9, i=2, cost=6: a>e,a>f,a>g,b>h,b>i
find_70(a,b,c,d,e,f,g,h,i) =
  if c > d
  then find_71(a,b,c,e,f,g,h,i,d)
  else find_71(a,b,d,e,f,g,h,i,c)
# n=9, i=2, cost=5: a>d,a>e,a>f,b>g,b>h,c>i
find_71(a,b,c,d,e,f,g,h,i) =
  if b > c
  then find_24(a,b,d,e,f,c,g,h)
  else find_23(a,c,d,e,f,b,i)
# n=11, i=2, cost=7: a>f,a>g,a>h,b>i,b>j,c>k
find_68(a,b,c,d,e,f,g,h,i,j,k) =
  if d > e
  then find_72(a,b,c,d,f,g,h,i,j,k,e)
  else find_72(a,b,c,e,f,g,h,i,j,k,d)
# n=11, i=2, cost=6: a>e,a>f,a>g,b>h,b>i,c>j,d>k
find_72(a,b,c,d,e,f,g,h,i,j,k) =
  if c > d
  then find_73(a,b,c,e,f,g,d,j,h,i)
  else find_73(a,b,d,e,f,g,c,k,h,i)
# n=10, i=2, cost=5: a>d,a>e,a>f,b>i,b>j,c>g,c>h
find_73(a,b,c,d,e,f,g,h,i,j) =
  if b > c
  then find_24(a,b,d,e,f,c,i,j)
  else find_24(a,c,d,e,f,b,g,h)
# n=15, i=3, cost=12: a>g,a>i,a>o,b>j,c>n,d>k,e>l,f>m,g>o
find_2(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if a > b
  then find_74(a,c,d,e,f,b,g,h,i,l,m,k,n,j,o)
  else find_75(b,a,c,d,e,f,h,j,n,l,m,k,i,g)
# n=14, i=3, cost=11: a>b,a>h,a>m,a>n,b>m,b>n,c>i,d>l,e>j,f>k
find_75(a,b,c,d,e,f,g,h,i,j,k,l,m,n) =
  if a > c
  then find_6(a,b,d,e,f,c,g,h,l,k,j,m,n,i)
  else find_7(c,a,d,e,f,g,i,l,k,j,b,h)
# n=15, i=3, cost=11: a>f,a>g,a>i,a>n,a>o,b>m,c>l,d>j,e>k,f>n,g>o
find_74(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) =
  if b > c
  then find_65(a,b,d,e,f,g,c,h,i,m,k,j,l,o,n)
  else find_65(a,c,d,e,f,g,b,h,i,l,k,j,m,o,n)
