bool isPrefix(const Cell* A, const Cell* B)
{
  if(A == NULL) return true;
  else if(B == NULL) return false;
  else if(A->item == B->item) return isPrefix(A->next, B->next);
  else return false;
}