choices[][] = [ [ 5 15 ] [ 5 16 ] [ 5 19 ] [ 6 17 ] [ 6 18 ] [ 7 14 ] [ 7 16 ] [ 8 14 ] [ 8 15 ] [ 8 17 ] ]
len mwud[] 12
# 
func sumeq ind d .
   for i to len choices[][]
      sum += if d = choices[i][ind]
   .
   return sum
.
for step = 1 to 4
   del[] = [ ]
   for i = len choices[][] downto 1
      m = choices[i][1]
      d = choices[i][2]
      if step = 1
         if sumeq 2 d = 1
            mwud[m] += 1
         .
      elif step = 2
         if mwud[m] <> 0
            del[] &= i
         .
      elif step = 3
         if sumeq 2 d <> 1
            del[] &= i
         .
      else
         if sumeq 1 m <> 1
            del[] &= i
         .
      .
   .
   for d in del[]
      swap choices[d][] choices[$][]
      len choices[][] -1
   .
.
print "month:" & choices[1][1] & " day:" & choices[1][2]
