question: is the nearest red item the same shape as the farthest green item?
#1 return red item 
#2 return #1 that is  nearest 
#3 return green item 
#4 return #3 that is  farthest 
#5 return shape of #2 
#6 return shape of #4 
#7 return if #5 is  the   same as #6