VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "cNodeCollection"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

' Full Version  Full Version  Full Version  Full Version
' ********************************************************
'       FULL VERSION NODE-BASED COLLECTION CLASS
' ********************************************************
' Full Version  Full Version  Full Version  Full Version


' DESCRIPTION:  A node-based, parent-child, collection class.
'   This class combines treeview-like collections with VB's collection & dictionary objects. Collection items have heirarchy.
'   Can be used without hierarchy by simply not provding a Parent/Sibling Key when adding items


' CHANGE HISTORY
'--------------------------------------------------------------------------------------------------------------
'  Updated the MethodsProps.rtf file, as needed, with every change
' 17 Dec 06. Added support to for saving persistent objects in SaveCollection
'   - persistent objects include stdPictures and stdFonts
' 15 Dec 06. Finalizing project.
'   - Found in specific scenarios, a deserialized object's reference count was one more than it should be. Corrected
'   - When creating arrays, array features are now determined and added to the array attributes for all array types
'   - Variants containing UDTs (user-defined types) are not persisted when saving collection
'       -- UDTs can be saved to a Variant only if the UDT is public in a class within a compiled reference (DLL, OCX, etc)
'   - Variants returning a VarType of vbError or vbDataObject are not persisted when saving collection
'       -- Haven't been able to break those down at this point. IUnknown objects appear, from testing, to be vbDataObjects
' 14 Dec 06.
'   - Completely revamped the serialization and deserialization routines
'     (See GetSerializedItem & SetSerializedItem)
'       -- Now all array types, including variant arrays, are supported
'       -- Arrays are no longer restricted to number of dimensions
'       -- Objects (i.e., Classes) within arrays still need to be serialized by user
'       -- Parameters in Public Event SerializeObject has been changed
'   - Added tons of remarks to the serialization & deserialization routines
' 10 Dec 06.
'   - Playing more with manipulating multidimensional arrays via pointers.
'       -- Removed logic that wrapped the collection item in a variant. This actually
'          forces VB to copy the array and we don't need a copy;
'          we can work directly off the collection item vs a variant wrapper
' 9 Dec 06.
'   - Added SiblingOffsetIndex method
'   - Changed SortCollection to return True if successful
'   - Changed SaveCollection & LoadCollection to return True if successful
'   - Upgraded SaveCollection to auto-save multidimensional arrays of all data types
'       except Variants and Objects/UDTs (those still require SerializeObject event)
'       -- With above exceptions, any multidimensional array containing more than
'          10 dimensions will no longer be able to be saved/persisted
'       -- Resulted in permanent removal of Public Events SerializeStringArray & SerializeArray
'   - Changed ClearKeys method to clear individual branch levels or entire collection
'   - Renamed CountCollection to ItemCount
'   - Renamed CountChildren to ChildCount
'   - Removed IsSiblingOf. Calling myCol.Parent(Index)=myCol.Parent(OtherIndex) results in same thing
'   - Removed CountSiblings. Calling myCol.ChildCount(ParentIndex) results in same thing
'       -- when ParentIndex is zero or vbNullString, root level nodes are counted
' 8 Dec 06.
'   - Found minor bugs in the ShellSortString routine. Fixed
'   - Added optional parameter in MoveItem to allow a new key to be assigned along with the move
'   - Merged the AddKey routine into the FindKey routine; no need to keep it separate
' 7 Dec 06.
'   - the FamilyTreeStructure, when used, was being dimensioned with 3 elements; only 2 are needed. Changed
'   - Added SortCollection method
'       -- Required new supporting routines: ShellSortNumbers, ShellSortString, SortRecursiveNodes, SortNodeLevel
'   - Added additional Relationship enumerations to allow sorting when a child node is added or moved
'       -- Required new supporting routine: GetChildInsertPosition
'   - Added IndexFromKeyIndex method
'   - Changed Parent function to a read/write property
'   - Removed obsolete enumerations
' 6 Dec 06 - Initial release
'--------------------------------------------------------------------------------------------------------------

' Highlights include....
' ============================================================================================================
' 1) Key or key-less items. Keys can be numeric or not, case-sensitive or not. vbNullString is reserved and cannot be used.
' 2) TreeView-Like methods:  AddItem(item,key,parent or sibling), First/Next/PreviousSibling, First/LastChild, etc
' 3) Assigned keys can be changed as desired, but still must be unique if used.
' 4) Nodes, and any children, are moved/deleted in one call
' 5) Provides nice-to-have functions like KeyExists, KeyToIndex, HasChildren, MoveItem (from one node to another) & more
' 6) Change contents of an item without having to delete/re-add
' 7) Fast navigation via doubly linked lists
' 8) Value-based collection; therefore, instantiated objects (i.e., Classes) added to collection are kept alive until removed from collection
' 9) Has ability to save/load collection with restrictions. If you use this ability, declare this class WithEvents
'     See SaveCollection, LoadCollection, and the Public Event
' 10) Now has sorting ability too

' SPECIAL CONSIDERATIONS.....
' ============================================================================================================
' 1) Collection heirarchy are linked lists. Indexes of items should not be cached by you.
'    Indexes change dynamically when items are deleted or a new collection is loaded
' 2) Above being said, keys should be used. If keys aren't used, then you should use the
'    following methods to obtain indexes or to loop thru the collection:
'    - FirstChild, LastChild returns relative indexes based on a passed parent node index/key
'    - FirstSibling, LastSibling returns relative indexes based on passed sibling node index/key
'    - NextSibling, PreviousSibling returns relative indexes based on passed sibling/child node index/key
'    - SiblingOffsetIndex returns sibling x positions from the first or last sibling
'       Whenever a Child or Sibling index method returns zero, you are at the beginning or end of the branch
' 3) Speaking of keys. Since numeric keys can be used too, all methods, that allow
'    a Variant Key/Index, have no way of knowing if "1234" is a numeric key or an index.
'    The type of passed variable determines whether the class treats the parameter as a
'    key or index. VarType of String are ALWAYS treated as Keys, whereas,
'    VarType of Byte,Integer,Long,Single,Double,Currency are ALWAYS treated as Indexes
'    Example:
'       Dim strIndex As String, lngIndex As Long
'       Dim strKey As String, lngKey As Long
'       strIndex="99": lngIndex=99
'       strKey="-123899": lngIndex=-123899
'    Getting Item by Index:  Either Class.Item(lngIndex) or Class.Item(CLng(strIndex))
'    Getting Item by Key: Either Class.Item(strKey) or Class.Item(CStr(lngKey))
' 4) Sorting
'    - The collection can now be sorted. See SortCollection method for restrictions in what can and cannot be sorted.
'    - Another option is to assign keys which are sorted (remember keys can be numeric or not), you can request an
'       item by its key index. Keys are always sorted ascending order. To reverse sort, get the item's key index
'       in descending order.  See IndexFromKeyIndex method.
'    - Yet another option is to dictate where an item is to be added to a collection by properly identifying
'       which Sibling the item should be added before or after.
'   Once items are set in their positions, their positions can only be changed using 4 methods. Even if an item's
'   index changes due to collection item deletes, the remaining items' positions relative to their siblings do not
'   change. The 4 methods that change positions of items are AddItem, MoveItem, MoveChildren, SortCollection

' RESTRICTIONS/LIMITATIONS
' ============================================================================================================
' 1) The LoadCollection, SaveCollection, SaveProperties, GetSerializedItem & the Public Events should be removed for VB5 users.
'    - VB5 does not support creating property bags. i.e., Set ppBag=New PropertyBag is an error in VB5
'    - Should you still want to replicate the LoadCollection/SaveCollection functions, you will have to write your own.
'       Suggest possibly using something similiar to an INI file format and caching the bytes of that file?
'    - Likewise, the example below for SerializeObject, of serailizing a class, will need to be reworked/rethought for VB5 users.
' 2) Sorting on items containing primarily objects can only be successful 100% of the time when all of the objects
'    have a common public property whose value can be compared/sorted. Otherwise, you will need to sort the objects yourself

' PUBLIC EVENTS
' ============================================================================================================
' Should you want this class to cache the collection, it can, except for objects; is that true?....
' NOTE: This class doesn't save anything, it organizes the entire collection into an array
' that is passed via the SaveCollection method. That array can be written by you to a user file or,
' if this is used within a usercontrol, to the property bag (yes, property bags can store byte arrays,
' but not arrays of other data types). That same array must not be altered thereafter and then can be
' passed to the LoadCollection method to re-create the collection. Interested?  Read just a little bit more.

' When your collection contains objects (i.e., Classes), you will need a way of serializing your class
' into a byte array and pass the byte array as a response to the SerializeObject Event when it is
' called.  This event is called from SaveCollection method to get your serialized object and
' also from LoadCollection to pass the serialized array back to you for deserializing

' You will get this event called for each collection item or arrayed item of a collection item that contains an Object
Public Event SerializeObject(ByVal Serialize As Boolean, ByRef collectionObject As Object, ByRef DataArray() As Byte, ByRef ObjectID As String)

'   If Serialize=True :: You are to serialize the passed object into the DataArray()
'       collectionObject. A non-Nothing object within your collection.
'           -- Test the type object, if needed, by using TypeOf(collectionObject) Is classWhatever
'       DataArray(). An empty array you are to fill with the contents of the serailized object
'           -- The serialized object in DataArray can be multidimensional & any LBound.
'       ObjectID (Optional) :: a name you provide that uniquely distinguishes the kind of object it is. This is usually a Class Type.
'           -- When you get the array back for deserialization, you may or many not included flags to indicate which class/object
'               type it was created from (i.e., "cMyClass"). Therefore knowing which class to create from array may be impossible

'   If Serialize=False :: You are to deserialize the DataArray() into the passed collectionObject
'       collectionObject. An empty object to be set from the deserailized array
'           -- i.e, deserialize DataArray into a new classWhatever, then Set collectionObject=classWhatever
'       DataArray(). A populated array you are to use to create a new object
'           -- The DataArray will be same size, dimensions, and have same LBound/UBound you passed when Serialize=True
'       ObjectID (Optional) :: If the ObjectID was provided when Serialize=True, the the value you provided else vbNullString

' How do you serialize an object? For a class object, it is rather simple. This is just one possible way.
' - Create a Friend Function SaveClass(ClassBytes() As Byte) As Boolean
    ' - Within that function Dim myData As New PropertyBag
    ' - Just like an OCX, write your class values into the property bag
    ' - Pass the property bag like so:  ClassBytes() = myData.Contents()
' - Create a Friend Function LoadClass(ClassBytes() As Byte) As Boolean
    ' - Within that function Dim myData As New PropertyBag
    ' - Set the propety bag contents: myData.Contents() = ClassBytes(). Use On Error statement(s)
    ' - Just like an OCX, read your class values from the property bag



' TYPE DECLARATIONS, ENUMERATIONS AND CONSTANTS
' ============================================================================================================
' only API used; think this is a first for me--just one API ;)
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)

Private Type KeyStructure
    Index As Long                   ' index into the m_Col() array
    Key As String                   ' the key
End Type
Private Type FamilyTreeStructure
    Tree() As Long                  ' For parent nodes only, array contains First Child, Last Child indexes for fast insert/delete/enumeration
End Type
Private Type CollectStructure       ' contains relationships between node siblings/children
    Parent As Long                  ' index value of the parent node, if zero then this is a main level node
    Elder As Long                   ' if zero then this is the last sibling, else index of next sibling (linked list)
    Younger As Long                 ' if zero then this is the first sibling, else index of previous sibling (reverse linked list)
    Key As Long                     ' if zero then item is not keyed, else StrPtr of the Key: See VBStringFromBSTRpointer function
    Family As FamilyTreeStructure   ' See Structure above ^^
    Item As Variant                 ' your custom collection data item
End Type
    ' ^^ 20 bytes overhead/admin per item + 16 for the Variant + (if keyed add 8 bytes & if has children add another 8 bytes)
    
Private Enum eTreeMembers            ' internal use only
    treefirst = 1
    treelast = 2
End Enum
Public Enum eNodeRelationship   ' see AddItem for description of meaning
    relFirstSibling = 0
    relLastSibling = 1
    relNextSibling = 2
    relPrevSibling = 3
    relFirstChild = 4
    relLastChild = 5
    relChildSortedAsText_Asc = 6
    relChildSortedBinaryText_Asc = 8
    relChildSortedAsNumeric_Asc = 10
    relChildSortedAsText_Desc = 7
    relChildSortedBinaryText_Desc = 9
    relChildSortedAsNumeric_Desc = 11
End Enum
Public Enum eCompareEnum
    keyCaseSensitive = 0
    keyCaseInsensitive = 1
End Enum
Public Enum eSortLevel          ' see SortCollection & ClearKeys for description of meaning
    brchAllLevels = 0
    brchSiblings = 1
    brchChildren = 2
End Enum
Public Enum eSortOptions        ' see SortCollection for description of meaning
    srtTextText = 0
    srtTextBinary = 1
    srtAsNumeric = 2
End Enum

' possible return errors when adding/editing/removing items
Public Enum ErrorEnum
    ERROR_NOT_FOUND = &H80000500
    ERROR_KEY_DUPLICATED = &H80000501
    ERROR_INVALID_KEYINDEX = &H80000502
    ERROR_INVALID_RELATIVEKEY = &H80000503
    ERROR_INVALID_DATATYPE = &H80000504
    ERROR_INVALID_PROPERTY = &H80000505
    ERROR_INVALID_COLLECTION = &H80000506
    ERROR_MAXIMUM_ITEMS_REACHED = &H80000507
End Enum

Private Const MAXINT_4 As Long = 2147483647 ' max number of collection items
                                            ' also used in SafeOffset routine
' class wide variables
' ============================================================================================================
Private m_CompareType As eCompareEnum   ' key comparision; cannot be changed after 1st key is added to collection. Makes keys case sensitive or insensitive
Private m_Buffer As Long                ' buffer of n items (default is 10) to help prevent Redimensioning collection after each add
Private m_ItemCount As Long             ' number of items in the entire collection
Private m_KeyCount As Long              ' number of keys (items do not require keys)

Private m_Keys() As KeyStructure        ' array of keys used
Private m_Col() As CollectStructure     ' the collection
Private m_Objects() As Object           ' may be used temporarily when loading a previously saved object. Referenced in LoadColllection, SetSerializedItem

Public Function AddItem(Item As Variant, Optional ByVal Key As String = vbNullString, _
            Optional RelativeKeyIndex As Variant = vbNullString, _
            Optional ByVal Relationship As eNodeRelationship = relNextSibling) As Long

    ' PURPOSE: Add/append/insert an item into the collection
    
    ' Item.{Required} Any VB number, string, control, variant, object, etc
    ' Key.{Optional} A key to reference this new item by. The key must be unique, can be numeric or not. Cannot be Null
    ' RelativeKeyIndex.{Optional} The key or index to the node that the Relationship parameter applies too
    '       -- If is vbNullString or zero, then the root will be used
    ' Relationship.{Optional}. Default is relNextSibling
    '       -- relFirstChild. The new node will become the first child of the node ref'd by RelativeKeyIndex
    '       -- relLastChild. The new node will become the last child of the node ref'd by RelativeKeyIndex
    '       -- relFirstSibling. The new node will become the first child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relLastSibling. The new node will become the last child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relNextSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its next sibling
    '       -- relPrevSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its previous sibling
    '   The following do not apply for items containing arrays or objects and will reset to relLastChild if that case
    '       -- relChildSortedAsNumeric_Asc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsNumeric_Desc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsText_Asc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedAsText_Desc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedBinaryText_Asc. If item is String, place child in sorted position comparing siblings case-sensitive
    '       -- relChildSortedBinaryText_Desc. If item is String, place child in sorted position comparing siblings case-sensitive
    ' Return value. If no errors encounterd, return value is current Index of newly added item

    ' Note about Overflow checks in AddItem, DeleteNode and FindKey(adding a key)...
    ' IMO they are probably useless. If the collection got so big as to contain over
    ' a million items, user would probably run out of memory first. But we make the
    ' checks anyway as a measure of professionalism.
    
    Dim newIndex As Long, KeyIndex As Long, relIndex As Long, pIndex As Long
    Dim vType As Integer
    
    If Not RelativeKeyIndex = vbNullString Then ' validate relative's key/index exists
        relIndex = ConvertKeyToIndex(RelativeKeyIndex, True)
        If relIndex < 0 Then
            Err.Raise ERROR_INVALID_RELATIVEKEY, "Collection.AddItem", "Relative Key is Invalid"
        End If
    End If
    
    ' determine position of the new item
    If m_ItemCount = 0 Then
        newIndex = 1
    ElseIf m_ItemCount = MAXINT_4 Then
        ' what are the odds; better off checking anyway
        Err.Raise ERROR_MAXIMUM_ITEMS_REACHED, "Collection.AddItem", "The Collection Is Full"
    Else
        newIndex = m_ItemCount + 1
    End If
    
    If Not Key = vbNullString Then          ' validate the passed key is unique
        KeyIndex = FindKey(Key, newIndex)
        If KeyIndex < 0 Then
            Err.Raise ERROR_KEY_DUPLICATED, "Collection.AddItem", "Key Already Exists in this Collection"
        End If
    End If
    
    ' add the item to our m_Col() array
    If newIndex = 1 Then
        ReDim m_Col(0 To newIndex + m_Buffer)
    ElseIf UBound(m_Col) = m_ItemCount Then
        If newIndex >= MAXINT_4 - m_Buffer Then ' over 2.4 trillion items?
            ReDim Preserve m_Col(0 To MAXINT_4)
        Else
            ReDim Preserve m_Col(0 To newIndex + m_Buffer)
        End If
    End If
    
    m_ItemCount = m_ItemCount + 1
    ' the Key member are pointers; this allows caching key as 4 bytes vs Len(Key)*2+4 bytes (BSTR String)
    ' Also prevents reindexing m_Keys() array when it is added to or deleted from
    m_Col(newIndex).Key = StrPtr(m_Keys(KeyIndex).Key) ' requires a little work getting key. See VBStringFromBSTRpointer
    
    ' get the true varType.
    ' For example. VarType on a stdPicture returns vbLong not vbObject
    CopyMemory vType, ByVal VarPtr(Item), 2&
    vType = vType And Not &H4000    ' objects can be ByRef
    
    ' when not an object, use VB's VarType function
    If Not vType = vbObject Then vType = VarType(Item)
    Select Case vType
    Case vbObject, vbDataObject, vbError
        Set m_Col(newIndex).Item = Item
    Case Else
        m_Col(newIndex).Item = Item
    End Select
    
    If Relationship > relLastChild And Relationship < relChildSortedAsNumeric_Desc + 1 Then
        ' place in a sorted position.... determine the position among its other siblings
        pIndex = GetChildInsertPosition(newIndex, relIndex, (Relationship - 6 + (Relationship Mod 2 = 1)), (Relationship Mod 2 = 0))
        If pIndex = 0 Then ' this will be the last child
            Relationship = relLastChild
        Else    ' inserted before
            relIndex = pIndex                   ' cache the existing node's index
            Relationship = relPrevSibling       ' insert beore
            pIndex = 0
        End If
    End If
    
    ' add parent and sibling links as needed
    Select Case Relationship
    
        Case relFirstChild   ' this node will be 1st child of relIndex
            If IsArrayEmpty(Not m_Col(relIndex).Family.Tree) Then
                InitializeTree relIndex, newIndex
            Else
                With m_Col(relIndex).Family
                    m_Col(newIndex).Elder = .Tree(treefirst)    ' fwd index
                    m_Col(.Tree(treefirst)).Younger = newIndex  ' rev index
                    .Tree(treefirst) = newIndex
                End With
                m_Col(newIndex).Parent = relIndex
            End If
            
        Case relLastChild ' this node will be last child of relIndex
            If IsArrayEmpty(Not m_Col(relIndex).Family.Tree) Then
                InitializeTree relIndex, newIndex
            Else
                With m_Col(relIndex).Family
                    m_Col(.Tree(treelast)).Elder = newIndex     ' fwd index
                    m_Col(newIndex).Younger = .Tree(treelast)   ' rev index
                    .Tree(treelast) = newIndex
                End With
                m_Col(newIndex).Parent = relIndex
            End If
            
        Case relFirstSibling  ' (Insert At Beginning)
            pIndex = m_Col(relIndex).Parent
            If IsArrayEmpty(Not m_Col(pIndex).Family.Tree) Then
                InitializeTree pIndex, newIndex
            Else
                With m_Col(pIndex).Family
                    m_Col(newIndex).Elder = .Tree(treefirst)    ' fwd index
                    m_Col(.Tree(treefirst)).Younger = newIndex  ' rev index
                    .Tree(treefirst) = newIndex
                End With
                m_Col(newIndex).Parent = pIndex
            End If
            
        Case relLastSibling  ' (Append To End)
            pIndex = m_Col(relIndex).Parent
            If IsArrayEmpty(Not m_Col(pIndex).Family.Tree) Then
                InitializeTree pIndex, newIndex
            Else
                With m_Col(pIndex).Family
                    m_Col(.Tree(treelast)).Elder = newIndex     ' fwd index
                    m_Col(newIndex).Younger = .Tree(treelast)   ' rev index
                    .Tree(treelast) = newIndex
                End With
                m_Col(newIndex).Parent = pIndex
            End If
            
        Case relPrevSibling ' (InsertBefore)
            If relIndex = 0 Then    ' core root (Default Parameter) cannot have siblings. Use its children
                If IsArrayEmpty(Not m_Col(relIndex).Family.Tree) Then
                    InitializeTree relIndex, newIndex   ' collection not yet started, initialize it
                Else
                    relIndex = m_Col(relIndex).Family.Tree(treefirst) ' set current sibling to first sibling
                End If
            Else
                pIndex = m_Col(relIndex).Parent         ' user gave a non-root node, use it
            End If
            If Not relIndex < 1 Then
                ' update child links as needed
                If m_Col(pIndex).Family.Tree(treefirst) = relIndex Then m_Col(pIndex).Family.Tree(treefirst) = newIndex
                ' inserting node, set new node's linked list members
                m_Col(newIndex).Elder = relIndex                    ' fwd index
                m_Col(newIndex).Younger = m_Col(relIndex).Younger   ' rev index
                ' adjust moved node's linked list members
                If Not m_Col(relIndex).Younger = 0 Then ' not first sibling
                    ' make moved nodes younger sibling point to new node as its older sibling
                    m_Col(m_Col(relIndex).Younger).Elder = newIndex ' fwd index
                End If
                ' make moved node's younger sibling point to new node
                m_Col(relIndex).Younger = newIndex                  ' rev index
                m_Col(newIndex).Parent = pIndex
            End If
            
        Case Else   'relNextSibling ' (InsertAfter)
            If relIndex = 0 Then    ' core root (Default Parameter) cannot have siblings. Use its children
                If IsArrayEmpty(Not m_Col(relIndex).Family.Tree) Then
                    InitializeTree relIndex, newIndex   ' collection not yet started, initialize it
                Else
                    relIndex = m_Col(relIndex).Family.Tree(treelast) ' set current sibling to first sibling
                End If
            Else
                pIndex = m_Col(relIndex).Parent         ' user gave a non-root node, use it
            End If
            If Not relIndex < 1 Then
                ' update child stats as needed
                If m_Col(pIndex).Family.Tree(treelast) = relIndex Then m_Col(pIndex).Family.Tree(treelast) = newIndex
                ' inserting node, set new node's linked list members
                m_Col(newIndex).Elder = m_Col(relIndex).Elder       ' fwd index
                m_Col(newIndex).Younger = relIndex                  ' rev index
                ' adjust moved node's linked list members
                If Not m_Col(relIndex).Elder = 0 Then ' not last sibling
                    ' make moved nodes elder sibling point to new node as its younger sibling
                    m_Col(m_Col(relIndex).Elder).Younger = newIndex ' rev index
                End If
                ' make moved node's elder sibling point to new node
                m_Col(relIndex).Elder = newIndex                 ' fwd index
                m_Col(newIndex).Parent = pIndex
            End If
        
    End Select
    AddItem = newIndex
    
End Function

Public Function RemoveItem(KeyIndex As Variant) As Boolean

    ' PURPOSE: Remove a node from the collection. Any child nodes will also be removed
    
    ' KeyIndex. A key string or numerical Index to reference the item by
    ' Key cannot be vbNullString and the Index cannot be < 1
    
    Dim Index As Long
    Index = ConvertKeyToIndex(KeyIndex, False)
    If Index < 1 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.RemoveItem", "Invalid Key or Index"
    Else
        RemoveItem = DeleteNode(Index)
    End If

End Function

Public Function RemoveChildren(ParentKeyIndex As Variant) As Boolean

    ' PURPOSE: Remove all child nodes, and their children, from ParentKeyIndex
    
    ' ParentKeyIndex. A key or Index to reference the item by
    ' - Passing zero or vbNullString will result in entire collection being removed
    
    Dim Index As Long, sKey As String, kIndex As Long
    Index = ConvertKeyToIndex(ParentKeyIndex, True)
    If Index < 0 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.RemoveItem", "Invalid Key or Index"
    ElseIf Index = 0 Then
        Call ClearCollection
    Else
        If Not IsArrayEmpty(Not m_Col(Index).Family.Tree) Then
            ' when deleting nodes, a 2 node swap is actually used...
            ' This can cause an index to change during recursion in DeleteNode method
            ' So we use a key so we can easily identify the node index
            If m_Col(Index).Key = 0 Then    ' no key; create one
                sKey = RandomKey
                kIndex = FindKey(sKey, Index)
                m_Col(Index).Key = StrPtr(m_Keys(kIndex).Key)
            Else                            ' use existing key
                sKey = VBStringFromBSTRpointer(m_Col(Index).Key)
            End If
            Do Until IsArrayEmpty(Not m_Col(Index).Family.Tree) = True
                DeleteNode m_Col(Index).Family.Tree(treelast)
                Index = m_Keys(FindKey(sKey)).Index
            Loop
            If Not kIndex = 0 Then
                ' we created a key for this node; remove it now
                DeleteKey , sKey
                m_Col(Index).Key = 0
            End If
        End If
    End If
    RemoveChildren = True
    
End Function

Public Function MoveItem(KeyIndex As Variant, TargetKeyIndex As Variant, _
                Optional ByVal Relationship As eNodeRelationship = relNextSibling, _
                Optional NewKey As String) As Boolean

    ' PURPOSE: Move a node from current position to a new position and possibly a new parent.
    
    ' KeyIndex. A key or Index to reference the item to move. Cannot be zero or vbNullString
    ' TargetKeyIndex. The key or index to the node that the Relationship parameter applies too
    '       -- If is vbNullString or zero, then the root will be used
    ' Relationship.{Optional}. Default is relNextSibling
    '       -- relFirstChild. The new node will become the first child of the node ref'd by RelativeKeyIndex
    '       -- relLastChild. The new node will become the last child of the node ref'd by RelativeKeyIndex
    '       -- relFirstSibling. The new node will become the first child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relLastSibling. The new node will become the last child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relNextSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its next sibling
    '       -- relPrevSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its previous sibling
    '   The following do not apply for items containing arrays or objects and will reset to relLastChild if that case
    '       -- relChildSortedAsNumeric_Asc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsNumeric_Desc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsText_Asc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedAsText_Desc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedBinaryText_Asc. If item is String, place child in sorted position comparing siblings case-sensitive
    '       -- relChildSortedBinaryText_Desc. If item is String, place child in sorted position comparing siblings case-sensitive
    ' NewKey.(Optional). If provided, the item will be keyed with the new key.
    '       -- If the key results in a duplicate key, an error occurs
    ' Return value. If no errors encounterd, return value is True
    
    Dim bNewTree As Boolean
    Dim moveAfter As Boolean, kIndex As Long
    Dim Index As Long, TgtIndex As Long
    
    If m_ItemCount < 2 Then Exit Function
    
    ' validate the KeyIndex and TargetKeyIndex
    Index = ConvertKeyToIndex(KeyIndex, True)
    If Index < 0 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.MoveItem", "Invalid Source Key or Index"
    End If
    TgtIndex = ConvertKeyToIndex(TargetKeyIndex, True)
    If TgtIndex < 0 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.MoveItem", "Invalid Destination Key or Index"
    End If
    
    If Not NewKey = vbNullString Then Me.Key(Index) = NewKey
    
    If Relationship > relLastChild And Relationship < relChildSortedAsNumeric_Desc + 1 Then
        ' place in a sorted position.... determine the position among its other siblings
        kIndex = GetChildInsertPosition(Index, TgtIndex, (Relationship - 6 + (Relationship Mod 2 = 1)), (Relationship Mod 2 = 0))
        If kIndex = 0 Then ' this will be the last child
            Relationship = relLastChild
        Else    ' inserted before or after an exisiting node
            TgtIndex = kIndex                   ' cache the existing node's index
            Relationship = relPrevSibling       ' descending order, insert after
        End If
    End If
    
    Select Case Relationship
    Case relFirstChild, relLastChild
        If IsArrayEmpty(Not m_Col(TgtIndex).Family.Tree) Then
            ' target index has no children yet
            bNewTree = True
        Else
            ' set the adjusted target index based on Relationship
            If Relationship = relLastChild Then
                moveAfter = True
                TgtIndex = m_Col(TgtIndex).Family.Tree(treelast)
            Else
                TgtIndex = m_Col(TgtIndex).Family.Tree(treefirst)
            End If
        End If
    Case relFirstSibling ' set the adjusted target index based on Relationship
        TgtIndex = m_Col(m_Col(TgtIndex).Parent).Family.Tree(treefirst)
    Case relLastSibling ' set the adjusted target index based on Relationship
        TgtIndex = m_Col(m_Col(TgtIndex).Parent).Family.Tree(treelast)
        moveAfter = True
    Case relNextSibling ' set the adjusted target index based on Relationship
        If m_Col(m_Col(TgtIndex).Parent).Family.Tree(treelast) = TgtIndex Then
            moveAfter = True
        Else
            TgtIndex = m_Col(TgtIndex).Elder
        End If
    Case relPrevSibling
        ' no adjustment needed; default value is moveBefore not moveAfter
    End Select
        
    If Index = TgtIndex Then    ' if the source & target are same, simply abort
        MoveItem = True
        Exit Function
    End If
    
    ' moving is a rather simple process of updating linked lists,
    ' the physical arrays won't be touched; their linked lists are just updated
    ' 1) The previous and next sibling links around the moved node must now connect to each other
    ' 2) the previous and next sibling links around the new node position must now connect to the moved node
    
    ' Adjust the current node sibling references
    ' update linked lists around this node. We will be removing it from the chain
    With m_Col(Index)
        If .Younger = 0 Then ' this was the first sibling
            If .Elder = 0 Then  ' this was also the last sibling; an only child
                Erase m_Col(.Parent).Family.Tree()
            Else
                m_Col(.Parent).Family.Tree(treefirst) = .Elder ' the next sibling is now the first
                m_Col(.Elder).Younger = 0        ' and it has no previous sibling
            End If
        Else    ' make this node's prev sibling reference this node's next sibling
            m_Col(.Younger).Elder = .Elder
        End If
        
        If .Elder = 0 Then ' this was the last sibling
            If Not .Younger = 0 Then
                m_Col(.Parent).Family.Tree(treelast) = .Younger  ' the prev node is now the last child
                m_Col(.Younger).Elder = 0          ' and it has no next sibling
            End If
        Else    ' make this node's next sibling reference this node's prev sibling
            m_Col(.Elder).Younger = .Younger
        End If
    End With
    
    ' Adjust target position & its sibling's References. We will be inserting into the chain
    If bNewTree Then
        InitializeTree TgtIndex, Index
        m_Col(Index).Elder = 0
        m_Col(Index).Younger = 0
    Else
        ' now adjust the target node's siblings/parent linked lists
        With m_Col(TgtIndex)
            If moveAfter = True Then
                If .Elder = 0 Then  ' was last child; moved node now is
                    m_Col(.Parent).Family.Tree(treelast) = Index
                Else
                    m_Col(.Elder).Younger = Index
                End If
                m_Col(Index).Elder = .Elder
                m_Col(Index).Younger = TgtIndex
                .Elder = Index
            Else
                If .Younger = 0 Then ' was first child; moved node now is
                    m_Col(.Parent).Family.Tree(treefirst) = Index
                Else
                    m_Col(.Younger).Elder = Index
                End If
                m_Col(Index).Elder = TgtIndex
                m_Col(Index).Younger = .Younger
                .Younger = Index
            End If
            m_Col(Index).Parent = .Parent   ' set the new parent
        End With
    End If
    MoveItem = True

End Function

Public Function MoveChildren(ParentKeyIndex As Variant, TargetKeyIndex As Variant, Optional ByVal Relationship As eNodeRelationship = relNextSibling) As Boolean

    ' PURPOSE: Move a node chain from current position to a new position and possibly a new parent.
    
    ' ParentKeyIndex. A key or Index to reference the parent node by
    ' TargetKeyIndex. The key or index to the node that the Relationship parameter applies too
    '       -- If is vbNullString or zero, then the root will be used
    ' Relationship.{Optional}. Default is relNextSibling
    '       -- relFirstChild. The new node will become the first child of the node ref'd by RelativeKeyIndex
    '       -- relLastChild. The new node will become the last child of the node ref'd by RelativeKeyIndex
    '       -- relFirstSibling. The new node will become the first child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relLastSibling. The new node will become the last child of the parent of the node ref'd by RelativeKeyIndex
    '       -- relNextSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its next sibling
    '       -- relPrevSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its previous sibling
    '   The following do not apply for items containing arrays or objects and will reset to relLastChild if that case
    '       -- relChildSortedAsNumeric_Asc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsNumeric_Desc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
    '       -- relChildSortedAsText_Asc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedAsText_Desc. If item is String, place child in sorted position comparing siblings non case-sensitive
    '       -- relChildSortedBinaryText_Asc. If item is String, place child in sorted position comparing siblings case-sensitive
    '       -- relChildSortedBinaryText_Desc. If item is String, place child in sorted position comparing siblings case-sensitive
    ' Return value. If no errors encounterd, return value is True
    
    Dim moveAfter As Boolean, bNewTree As Boolean
    Dim Index As Long, TgtIndex As Long
    
    If m_ItemCount < 2 Then Exit Function
    
    ' validate ParentKeyIndex and TargetKeyIndex
    Index = ConvertKeyToIndex(ParentKeyIndex, True)
    If Index < 0 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.MoveChildren", "Invalid Source Key or Index"
    End If
    TgtIndex = ConvertKeyToIndex(TargetKeyIndex, True)
    If TgtIndex < 0 Then
        Err.Raise ERROR_INVALID_KEYINDEX, "Collection.MoveChildren", "Invalid Destination Key or Index"
    End If
    
    ' Note: Can't sort on the fly. The children may not be currently sorted and same goes for any existing children of the new parent
    ' So, if the Relationship parameter includes a sorted child item, we will sort post-move.
    
    Select Case Relationship
    Case relFirstChild, relLastChild, relChildSortedAsNumeric_Asc, relChildSortedAsNumeric_Desc, relChildSortedAsText_Asc, _
            relChildSortedAsText_Desc, relChildSortedBinaryText_Asc, relChildSortedBinaryText_Desc
        If IsArrayEmpty(Not m_Col(TgtIndex).Family.Tree) Then
            ' target node has no children, easy...
            ' set target's family.tree to the ParentKeyIndex's family.tree
            m_Col(TgtIndex).Family.Tree = m_Col(Index).Family.Tree
            Erase m_Col(Index).Family.Tree
            ' loop thru each of the child nodes and change the parent ref
            Index = m_Col(TgtIndex).Family.Tree(treefirst)
            Do Until Index = 0
                m_Col(Index).Parent = TgtIndex
                Index = m_Col(Index).Elder
            Loop
            If Relationship > relLastChild Then
                ' sort the children if requested
                SortNodeLevel TgtIndex, (Relationship - 6 + (Relationship Mod 2 = 1)), (Relationship Mod 2 = 0), True, vbNullString
            End If
            MoveChildren = True
            Exit Function
        Else
            If TgtIndex = Index Then
                MoveChildren = True ' no action of target and source parents are same
                Exit Function
            End If
            If Relationship = relLastChild Then
                moveAfter = True
                TgtIndex = m_Col(TgtIndex).Family.Tree(treelast)
            Else
                TgtIndex = m_Col(TgtIndex).Family.Tree(treefirst)
            End If
            Index = m_Col(Index).Family.Tree(treefirst)
        End If
        
    Case relFirstSibling ' target position is parent's first child
        TgtIndex = m_Col(m_Col(TgtIndex).Parent).Family.Tree(treefirst)
        
    Case relLastSibling ' target position is parent's last child
        TgtIndex = m_Col(m_Col(TgtIndex).Parent).Family.Tree(treelast)
        moveAfter = True
        
    Case relNextSibling ' target position is next sibling
        If m_Col(m_Col(TgtIndex).Parent).Family.Tree(treelast) = TgtIndex Then
            moveAfter = True
        Else
            TgtIndex = m_Col(TgtIndex).Elder
        End If
        
    Case relPrevSibling
        ' no adjustment needed; default value is moveBefore not moveAfter
    End Select
        
    If Index = TgtIndex Then    ' if the source & target are same, simply abort
        MoveChildren = True
        Exit Function
    End If
    
    ' moving is a rather simple process of updating linked lists,
    ' the physical arrays won't be touched; neither will there indexes
    With m_Col(TgtIndex)
        If moveAfter = True Then
            If .Elder = 0 Then
                ' target was last child; now new child tree is last
                m_Col(.Parent).Family.Tree(treelast) = m_Col(m_Col(Index).Parent).Family.Tree(treelast)
            Else
                ' make tgtIndex next sibling ref new tree's last child
                m_Col(.Elder).Younger = m_Col(.Parent).Family.Tree(treelast) = m_Col(m_Col(Index).Parent).Family.Tree(treelast)
            End If
            m_Col(Index).Younger = TgtIndex
            .Elder = Index
        Else
            If .Younger = 0 Then
                ' target was first child; now new tree is first
                m_Col(.Parent).Family.Tree(treefirst) = Index
            Else
                ' make tgtIndex prev sibling ref new tree's first child
                m_Col(.Younger).Elder = Index
            End If
            ' new tree's last sibling's next sibling is the target
            m_Col(m_Col(m_Col(Index).Parent).Family.Tree(treelast)).Elder = TgtIndex
            ' make new tree's prev sibling ref target's prev sibling
            m_Col(Index).Younger = .Younger
            ' target's prev sibling is not new tree's last sibling
            .Younger = m_Col(m_Col(Index).Parent).Family.Tree(treelast)
        End If
    End With
    ' clear the old family.tree
    Erase m_Col(m_Col(Index).Parent).Family.Tree
    
    ' loop thru changing the parent of all moved children; changing Parent ref
    Do Until Index = 0
        If m_Col(Index).Parent = m_Col(TgtIndex).Parent Then Exit Do
        m_Col(Index).Parent = m_Col(TgtIndex).Parent
        Index = m_Col(Index).Elder
    Loop
    
    If Relationship > relLastChild And Relationship < relChildSortedAsNumeric_Desc + 1 Then
        ' simply ensure tgtIndex's children are sorted
        SortNodeLevel TgtIndex, (Relationship - 6 + (Relationship Mod 2 = 1)), (Relationship Mod 2 = 0), True, vbNullString
    End If
    MoveChildren = True

End Function

' PURPOSE: Get/Set the value of a collection item
Public Property Get Item(KeyIndex As Variant) As Variant
    ' KeyIndex. A key or Index to reference this item by
    '   - Cannot be vbNullString nor zero
    
    ' Note about referencing items that contain arrays.
    ' If I wanted to reference the 5th array element of an array contained in Item,
    ' my code would look something like the following.....
    ' Debug.Print myCol.Item("KeyOfItem")(5)
    
    ' for Items that contain arrays of objects, then we could use something like
    ' Set NewClassObject = myCol.Item("KeyOfItem")(5)
    ' or if you wanted to view the value of a Public class property named Misc...
    ' Debug.Print myCol.Item("KeyOfItem")(5).Miscd look sometplies too
 operty namedotargepn't  End If
    End With
    ' clear the old family.cingarrays ong Parenst up     If long Parenroperty named; neit/s      
 sObject C 2 = 0)onship <  The following do n(ef
 ndex. The his ling is the targeult is sObject Cdex) ne   MoveChi&efeu) ne   Move siblings&ects, t=de parent of t is sObject Cdex) ne   MoveChi&efeu) ne   Move siblings&ects, t=de parent of t is sObject Cdex) mily.
    Sele ne   MoveCleme     End   MoveChi&efeu) neto refeao..
    'relFirstSief new   s last
         's prev Agirst child; now new tree  Exit Function
    
    End If
          eTrue
        Exit Funeeitherent of t is in arrat is irrrrrrrrrrce parents End With
    ' d WiahO, newIn End es
    With m_ic_Desc + 1 Then
eldSortedAsNumeric_Desc + ,e-sensue, v   hWiahO, newI,K  ' the prev 
  
    With m_ic_De  Endroperty namerelFirstSief ildSsObject C 2n  ' my code would o his x
                End If
             tmyCot = m_Col(e preA
   )l(m_Col(Index)Invalid Destination Key or nsue,ild; If mibling  ' (Append To End)rent of the to((((((((((x)
   Col(e(tr-esc2 = 1))lFd If
   'n Kee       ex Then
   aAndex) si v > rel
      
    ' Debug.Print myC5ulds sis 1))lFd IfBa ti= 1)), (Relationship Mod 2 = 0), True, vbNullString
          
                End ux).Elder
 d If
             tmyCot = m_Col(e hptmyCot =y:    ldSortedAsNumeric_Desc + 1 Then
        ' simply ensure te abx) mi  ldSortedAAAAAAAAAAAAText_Asc. If te ab=next sibling ref new tree)lFd IfBF  1)), mren=======r simply ast) = m_Coeee)lFd IfBF  1)),            tmyCo   asitive
    'o   asitive
If
 aAndex) si v ly eleme      next siba====r simply ast) = m_Cla#ing
l  ' thCoeee)blinry:    ldde would o his x
                End H0
    laveChi&efeu) ne   Move gant
    ' KeyIndex. A1sopareex )    , (Relationshiethen'   asitive
IfIast
    ).Elder
 d Imndex. ,   End I ,   ve
    o his x
    , Inng i
 obf you n    p        hip <ast
   get are satherent of t is in arrat is irrrrrrrrrrce parents End With
    ' d WiahO, n   If Tg
 obfaationsh)I 
End Funch   End If
            ' new tree's last sibling'd De
    laveCiblinSortedAsNumeric_Desc, relChildSortedAsTeleme      next End W  EndrolIf I.ce parents End With
    ' d rtedAAAAAAAAAAAATeo(treelast               
                End ux).Elder
 d If
             tmyCot = m_Col(e hptmyCot =y:    ldSo
    ' d De
 ' uroperty name
 t).Family.TrfBF nsuct Cdex)operty na name
AAAAText_Ascve
    'o   asu) ne wy.TrfBx's fami    ===tFunction

<aswiCol(.Eldeqc_Desc + 1    Case rel  tmyCot = encounterd, t =ulIf I.ce parents E name
  1)),           FHtmypL Ibjectk), True, vbNu4        )operty na name
AAAAText_Aseqc_Desc + 1    Caisitive
    ' Re With m_ic_Den' vWith
    '
AAAAText_Asem   -- relChildSortedAsText_Asc. If dexan array contained inNumeric_Desc + 1 Then
coIbj End HH TgtIndex E   'o   asitareObject Cdex) ne   Mov.Famiirrrr If
   areObje the fol. nsuRRRRRRRRRRRRRRRRRs       hat con uestel(TgtIndex).PaPardde would o his x
 
     dxt_Asem   -- relChildSortedAsTeol(e hptfsIn En,6    ,RRRRs  odeAsc. Ig
 uroper)defo d Famil.YouaoWith
            tmyCo   asitive
_Col(.PaFunction
Oex).Younger =ue, vbNu4        ra 
_Col(.PaFunction
Oex).Younger =ao   
                E'lino', (R,   
                E'linooooooooooooo   ' rev index
 v.lIftmypL Ibjectk), Tne  rences. We will be inserting iniring or Numeof tvalue of a ach otherP or Numeoevel unc'i amily.Tree(tree'oeoevelo.Sannotl be C    
 sObject C 2 = 0)onship <  The following do n(ef
 ndex. The h    m_Col(m_Col(_Col(Index).
        Else
            I
       bjectedAAAAAdd ux)C   m_Col(m_Co ux)C   neto     n(ef
dex).FatWith
            ndAAAA-,  ndAAAA-edAA     ol(m_Co ux)vtIndfNEal}. Dei = .Yok someh    m_tion
 dexan array contained inNumeric_Desc + 1 Then
coIbj End HH TgtIumersText_Asc. If dexanIbj End HH m)O, newh m_ic_Deuncldren are so(   'o   a_Asc. If dexqidd ux)C 00 Tic_D Else
perting iIf dexan array contained inNumeric_Desc + 1eitar ,d    
 serted between    -,een    - inNumert_Asem   )If
 eric_Descmd f(R,   
                  C  )If
oamimove.
  u(my contained inNumeric_T  m_Colwem
Public PropergM arraysx = 0em
Puba Pu(my contained inNumeric_T  m_ColwtiorgM  Index to referencey End If
 reref'd by ,d .9999999999999999s String or Nis in arrat   
         
   o(   'o   r&pL If Not m TgtIndex E   'o   Et    eol(e hinsuRRRRRRRRRRR= Ge
 debMbElder = newIndex     ' fwd index
                    m_Col(newInd    - 6 + (AsText             m_Col(new1 
   PuofNEal}. Dei llString
      /HH Tgt    s non catring
      /HH Eal}. Dei llString
      Youof a ach ov 
  
    Whdexan'
        ECnm2gtc. Ig
 String or Nistring
      inding is a ra Str'o   rhis x
        m_Col(.ec_Desc + 1    Caidex = m_Col(Index).El(Ind Youof a ach ov 
  
 ncldren a    , Inlo   Et- 
  
 nclt- 
 nd    - 6s  m_Col(.ec_Desc + 1  oe child in sorted po      m   )  Endroperty
 ncldren a  Im        Familsc. Ift Cdextion

PPPPPPPPP_Col(new1 
   PuofNEal}. Dei llString Puo   kgllString
        PuofNEa 2 = ePPPPPP_Col(new1 
   PuofNEal}. Dei ll}. Dei = .Yoe(Ind Ypal(Index).Key = 0
     1    Caidex = m_Col(Index).El(Ind Youof a ach ovnew1 
    TgtIndex
        HH m)O, n' fwd index
          E   ' PURPOw1 
 Cndex).Key = sNumericturn value is True
  PuofNEal}. Dow nertedAsTsuRRRRRRRRRdexng. Theiuarget ao) 1    Caiding like the followinmx).El(Ind 
       ions kchi
    End Sol(pI
      seld i Sol(p    ===tFunction
iahO, ney2d 
       ionsho   TgtIndex
        HH mn' fwd (nt
                SortNodeLevel TgtIndex, s True
  PuofNEal}. Dow nertedAsTsuRRRRRRR 
    i   ioship As eNodeRelationsE   ' Dim Index As Long,El(Inrue
  PuofNEal}. Dow nertedAsTspc_Desc + Dim Index As Long,El(Inrue
  Puef tar d, return va
 ncr   EndringFrom4me      next En occol(.ec_doccol(.ec_doccoring
gc sibliup     do n(ef
     --E TgtIndex =ooooooodAsTspc_m
P.ry ens           k.Family.Tree      Do UntiiiiiiiiillStrin  --E ethi/ccor slI If item is    wex '6 + (ReF   End I ,   ve
    o his x
    , Inng.ec_ertedAensurInng.ec_1 DoS(.ec_Desc 'd     eole   
  im Index A  , Inngan array co  kte   llStrinx '6 + b'gx Ailyr(.ec_Desc 'd     eole  True
   ioshrii   - 6ex = GetChil As LrtedAensurI
  PuofNEal}. Dow nertedAsTspc_Desc + Dim Indor if yontained inNumeriudexirtedhsibling'n arrays.
    'g'n arrays.
w neray     eossTspc_Ddexes
    , n' fwd index ve
dexeg'n arrd index ces. We will be0n ara .99(Append e them is    wex '6Lef tar d, return va
 ncr ve
dexeex
, return va
 ncr vekkkkk ing, pS       m pS    mexeex
As leelas       m pS    mexee  Puef tar d, rrt_Asem   )elasl(.Parent).Familry ens      Ce
    o his x
    , n)Indesem   )elasl(.Parent).Familry ens      tIndex, s True
nshrii     Ce
ux)C
l  ' thCog it from t        n va
 ncr velry ens      tIndex, s True
nshrii     Ce
ux)C
l  ' thCog it                 t,ce, s.srdes and changegs as Numbers
    '       -- relChildSortedAsTex(aIndor if &inx '6 gx(aInds     Er )elasl(.Parerue
nshrii   '       -- relCkis x
    , Inng.ec_positi   , ngs as Nusb
   4 te   m_aIndor if &inx '6 gx(aTrue
nshrii     Ce
ux)C
l  ' thCog it from t        n va
 ncr velry ens      tIndex, s True
nshrii     Ce
ux)C
l  ' thCog it  )elasalidatsCe
uo + 1  oe chil    n va
 ue
ns child n  i   h - Cannot ,t=o   , return va
 ncr lect Casenx '6 gx(aTrue
nshrii     Ce
ux)C
l  ' thCoing. The n (AsText  If bNx, s Tru m_Col(Index).Family.Tree(treelast)
                Index = m_Keys(FindKey(sKey)ollStrSortedAsText_ronsh   looktIndex).ly.  n va
atiry    mchisu,f tar d, r,xan array contaLsCol(e(tr-esc2 = 1))lFd If
Nparound the new node pos   h - Cannot ,t=o   , return ke th     ....rx '6Lef tar dt  If brii     Ce
- reuue
nshraLsCmndex).ag it  ) If Ind o) o) o) otar dt  If brihCoing. parentIeve'd     eol'ndex).Pare'd Ce
ux)       t,ce, sined inN..rx '6Le.Parent).Familp <  The foSortedAsText_ronsh   looktIndex).ly.  n , g. parentIeve'd     eol'ndex).Pare'd Ce
ux)       t,ce, sined inN..rx '6Le.Parent).Familp <  The foSox).ag it  ) ers
    '       -- relChildSortedAsTex(aIndor if &inx '6 gx(aInds     Er )elasl(.Parer the eri"c sibliup     do n(ely.cin   ve
   ewKey As String)   -- rel(aInds     E ' or if yomilry ens      tIndex, s T   mexeex  eol'ndex).Pare'd Ce
ux)       t,ce, sint Casenx '6 x
        H ction.m               Index ing
      i             Index ing
 eole   
(   'o  Puoyounger  ref'd e them is    wex '6Lef tar El(Inrue
    i  ).Famcif sxt En occol(u'd eIndexIndexIndext tar d, r,xan array contaLsCol(e(tr-esc2 = 1I E nam(aInrue ab=ee ab=ays l(Inrue
   
   tn occol(u'd eI.cin   
tring bjectk), Tne  rexan'
  rofNEa 2 = ePPPPPP_Col(neric_Asvvvvvvvvv
   
   tn vvvv
   
n vvvv
  er = m_Col(7lIIIIII Cannot ,t=o   , return ke theturn ke thetuSortedAsTex    t,ce, sined inN..array contaLsColov
  er = m_Cob/in sor Fun       eturn ke tned inOw1 
 Ctor if &d; If mi      Otreel0  er =aeric_Desc + tInde = m_Col(e preA
  oo
 opertyb ' RA 00 Tic_D  erico      mns child n  i   h - Cannot ,t=o   , return va
   Ce
exan'
  rofNEa 2fNE
  Cannot ,th sined inN. '       --preA
  oo  rofNNNNNNNNNNNNNNNrSortedAsTunger =..array contaLpgpThe foSox).ag it  )ta   tn vv foSox sorted pocp
     (aIndoeifNNot movex  wex '6Lef tar El(Inrue
    1d      wex '6I.ciVox  Inrue
 ring or Numeric, return va
   Ce
exann(neric_AsChild. The new node
   f tarLpgpTld; now new tIits nex Ce
ux)C
l  ' thCer = .Elder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
           Fam
  rofNf dhslder
                    
exan'
  rofNf dhslder
           Fam
  rofNf dhslder
                    
ex.Rd in) c1it      i      Index).KeaAn Fun       eturn ke tned inOw1 
 Ctor if &d; If mi      O    Indext    mex'6Lef tar Ev   tIndex, s1nean
    Dim moveAxan'aFam
 chimi   i    an'
 ved nodes eld dhslder     Fam
  rofNf dhKK dhKg 
 'urn ke tned inSex''''''ed nodes eld dhs_Dit  )ta)n'
  rof   
ex) 
 'urn keegs The new n      O    In)OInru-In)OInru-In)_Dit  )ta)With
        if you wavvvv
   T'6Lef tar Evlast (ddeLn)OI    In)azero, then t0    
    '       -- IXeld dhslderNf dhsldeo
 rMa unc'i0S'6 gx(aTrue
sen)azero, Pu(my cing y, I
             
exIveo
n occol(u'turn l(u'turn l(u'turC, Iry    rue
s99999999999- Cannotc  , n' fwd indiring      C 1pf dhKK dhKg 
 'urn ke tned inSex''''''ed Ia+hen t0    
    '       -- IXeld dhn node by
    'apply for it rhis x
        m_Col(.ec_Desc + 1    Caidex = m_Col(Index).El(Ind YoDei ll}. Dei = .Yoe(Indurn ke tned inSex''''''ed Ia+hen t0    
    '       -- IXeld dhpen the nocmp pocp
     (aIT      FHtrrent).Familry en)                 
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rofNf dhslder
                    
exan'
  rof,p   TgtIndex = ConvertKeyToIndex(TargetKeyIndex, True)
    If TgtIndex < 0 Then
        Err.Raise ERRORsa.dLef taf   
ex)mi   rgetKeyIndortedAsText_Desc. If iuPshraLsCmndexovskIndex      o siblings as Numbers
    '       -- relChildSortedAsTex)lFd If
Nparoun      FHtrr    n)               ' thCog it)lFd If) , n' fwd iv    
    ' = Convert(e(tr-esc2 = 1))le1o
           a         ' thC Unert(e(tr   Fa po d inN..,,x''t.Ra)fNEa if    vDit  )ta)se      Do Untc sortlDesc. u
              f    v    
Vox  Inrue
 ria    v    
Voy  T
  rofe(Indurn ke tned inio)          CT   mexeeh0 T/6Lef ta-- relChi Do Unto Unto Unto  Mo    '       -- ta--iv   rents    ' m       CT   mexeeh0 T/6Lef  o Unto Unto  Moa is not new tre   '       -- ta--iv   rents    ' m       CT   mexeeh0 T/6Lef  o Unto Unto  Moao renkthe nocmp pocp
     (aIT      FHa                   dSorted foox ing y thCogThen
        po      m   )  Endropertex'''''ria d inio)      Pe s sis 1))lFd IfBa ti= 1)), (Relationship Mod 2 = 0), True, vbNullString
          
                End ux).Elder
 d If
             tmyCot = m_Col(e hptmyCot =y:    ldSortedAsNumeric_rue)    '       -- .
exIvelingi    Er y.tree
s x
rs
    '    tk), True, vbNu4        )operty i6elationsr Ntt -- ta--iv   rellStrinNpv    
Vox  Inrounger ='d     eoleyEmpty( IfBa to   , return va
      , return va
     '       eoleyE,    pw    eole
              f    v    
Vox  Inrue
 ria    v    
Voy  cndext              ne  reasitive
Index(Pan
 terty i6elationsimne
ux)C
l  'n va
  , vbNu4        )open the nocmp pocp
     (we liR x
        m_Col(.ec_Desc + 1    Caidex u,f tar d, r,xan array contaLsCol(u4         
pppppppppppppptyb    Ce
exan'inSex''''m2gtc. Ig        return va''m2gse
          k), True, vbNu4    o his tmNum9sibling    
   vv
   T   ol(rel  Caidex uiR x
    OI    In)azeolationsimne
ux)C
l  'Gsm pS    me-,N    m_ldSortedAsNumeric_rue)    '    x
 s va'e s sis 1))lFd I1O    CT   mexeeao  M
ppppppis 1))lR'r    'CTrue, vbNu4 , place child in sort the   'o  Puoy          m_Col(ndex) siex As LonO1ra Str    'CTrue, vbNu4 End u Conve sort the   'o ctk),   -- IXeld dhsWndex LonO1ra Str    'n the nocm1ra Str            d 'r = .Younger
    d 'r = .Younger
    ger
    d 'r = .Yu   'o Dim moveAxan'aFaIxan'aFl  Caide sort eCol(.eolde IXeled foox inwe liR x
        m_Coll= .Yue, vbNull
 riNCTrue, vbNu4 ,
ppppppio adjustment needed;ppppsorteeeeeeeeeee
     he itedn vg'd D
    '2ive
I
    is    wex    tk)tneeded;pppps tmNum9sibling dn vg'dAed;pppps mi   i    an'
 ve is )ex''''''ed nodeNAthe chain
    Wc m_Col(IndDort aouo
d  CnCuld ne
ux)C
oy      o      m_Coll= mNum9smily.Tmily.Tmily.Tmily.Tmily.Tpw    eole
  e i       m_
ux)C
o (we T   ol(reNu4   ily.Tmily.Tmily occol(u'ddnexily.Tmily.Tmily.Tfmily.Tmily occol'r = .Yn , re  'CTrue, vbNu4 E      m(i    an'
 ve is )ex' = .Yk)ex' = .Yk)eTmileeeeefNf dhKy occol(u'ddnexily.Tmily.Tmily.odeAsc. ove g
    m(i    an'
 f dhKy objectedAAAAtlyr(.ec_Desc 'd .dAAAAta_Desc 'd .d End  Numeric, reDei ll}. Dei = .Yoe(Indate Oi   eAsc. ove sc ',te Oi   eAsc. op   TgtIndex =eDei ll inN..rx reDei leva
 ncr vel)   ayreDei leva
   ' PURPOSE: Remove tdCTrue, vbNSE: Remitive
Index(Pannt neede reDei ).FamDeiweumeric"d...
      sss    dhKy objet(ua
   ' PUndurn ke taPV If esc,pio adjustment nemitivemio adjustmeno    -- IXeld '2ive
I
    rC1ce childedAsT ' thCog it from t        n va
      n.-,m(i    ax)C
oy     vbNu4    o his tmNum9siblini 0
     1 Then
       linchipppps tmNum9sibg      C 1pfevURPOSux)vtI4 Eini 0
     vedURP linchioex' = .Yk)ea
 ue
eTmilee        )open the nV'dhKy objet(n'
  rofNf d         o  Puoy    sTmily od nodes tgtIndex).Familllllllllllllsef ta-- relChi Do UntNu4 E      Ia+he g. paag ue, vbNSE:c,pio adjustment FHa               an'
  r)opppppdURP linchioex' = .Yk)ea
 ue reDei ).FamDen       eturn ke tned'r    'CTrue, vbNu4 , place child in sort th'CTrue, vbNu4 , ue reD   ' m        oo
 ue rernt).FappdURP linchioex' = .Yk)ea
 ue pamDen       eturn ke tned'r    'CTrue, vbNu4 , place child inm(i.Youurn value is    eturn k relld, ndex, s True
nshrii   bl(Index)ag d EndEtned'r(Inde  , siblingkedcp    eturn ke tned'r    'CTWurn valdx)vtI4 Eini 0
     vedURP lue, vbNu4 , ue reD   '  n.-,mvedURP lue, vbNu4 , us child n  i   h -bne & tar      sKey = RandomKe Rand    Index inadjustmenoe g
  --iv   rexh -bne & tar   tIndex, s T   ndexxxxblingsEini 0
     ved'd .gndohi Do UntNu4stmenod nodes tgtIndex).Familllllllllllllsef ta-- relChi Do UntNu4 E  ,.bg      C nod nodes tgtlChi Do U Ran do Nu4stmenod nodes x    tk)tneedel*d    Index ides x    tk)-bne & taran do Nusu,f tar d,e chil reD he   'o ctk),   --enterd, t =ulIf I.a RelativeKeyIndex and its next sibling
    '       -- relPrevSinodocddo
 ue rernt).FappdURP linchbliterdlativeKeyIndex and fNEKRP d nodes tgtIndeln.-,mvedURP lue,POSux)vsTspc_man'
 ved nodes eld dhsld n  i   h -bne & ta)ronsh   lookf Ind hsld rdURPI.a& ta)ronsh   l IXeld '2ive
I
    rC1ce cnde-,m(iont.Parent).Family.Tree
  arent).Family.Tree
  arent).Family.Tree
  arent).Familyde liR x
        m_Col(.ec_Dv
   
 Nf dhsld x    tk)-bne & t Cdex h -bne & ta)ronsh    Unto Unto  Mo -bne &  an'
  r &  an'
  r ndex).i) .Yk)exkumeric, tNu4 E .       (Index).EldEnd With
   ds 1))lR'r ronsh   lookf Ind hsld rdURPI.ab)C
oy  dext tar d, , ont.Pa   rty i6elatio nodes tgtlChi Do U Ran do Nu4stmenod nodes x    tk)tneedel*d    In  m_Col tree's da/r Nf drteeeeee'd Cdexne & ta)ronsh nodx).Fami Dim moveAxan'af dhslder
    A-, return(
ux) d nodes's da/r Nf ds next sio2wsibg  ta)ronsh noeKeyIndSortedAAAAA'
 f oyqmNf drteeeeee'd Cdexne & ta)ronsh nodx).Famie just updatede
Index(Pan   Unto Unto  MedAAta)ronsh    Unto Unto  Mo -bn'd .gndohi Do UntNu4stmenod nodes tgtIn
 rero UntNu4stmenod nodevd rdUR    tar d,e chil reD he   'o ctk),   --enterd, t =ulIf I.a RelativeKeyIndex and its next sibling
    '       -- relPrevSinodocddo
 ue rei       Index Before not moveAii     Ce
- ]'(  Ce
- ]ndexA dhKy ]ndexA do
 ue rei   hi Do UntoooooooooooooooooooooooooooTmily.o'. t Co UntmoveAxb) do
 ue rei   hi Do Un  tte Oioionsh)I 
End Funch   End If
      n  i   h -bne & ta)ron0Vd nodes x    tk)tneedel*d    In  m_Col tree's da/r Nf drteeeeee'd Cdexne & ta)ro dhKyc,rcrrtIndex).Famiey or Insoa
        pnO1ra Str    pocE
 e & ta)i   hi Do Untoooooooooannt niri"c sibliup    soooq4   soooq4   soooq4   soooq4   soooq4   soooq4   sothi/cceld dhn node .oooooooooannt niri"c sibliup    soooq4   soooq4   soooq4   soooq4   soooq4   soooq4   sothi/cceld dhn node .oooooooooannt niri"                  
ex.Rd in) c1it      i      Index).KeaAn Fun       eturn ke tned inOw1 
 Ctor if &d; If mi      O    Indext    mex'6Lef tar Ev   tIndex, s1nean
    Dim moveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 veoq4   soo ke  chil reD he   mi   'd nTree
nc"d...
veChildrend, return va,1  tk)tneed niri") soooq4   soooq    Caidex u,f tar nTree
nc"d...
veChilsag d EndEtoq4   dex u,f tar nTrG
  r)opppppdURP linchioex'  eturn sag d EndEtoq4   dex u,f tar nThON 'CTrue, vbNu4t is sObject Cdex) neP linchq4   soord dhiIo t ie
  gtInhiIo    uveAxaThON 'C Cdex) neP linchq4Index
its next sibling
  cE
ThON edURP lup     dooooooooannt ni        d 'r = .Ymibliu the nV'K 'C Cdex) neP linchq4Iefore not moveAndex).Pare'd Ce
ux)       t,,,,,,,,qwald d    sKey s'r = .Younger
    d 'r = .Younger
    gerLlsagr = .Yolinch
nc"d...
veChildyde li-him ved nodes relPrev   s'r Cdex)  nodes relPrev   s'r Cdex)  nodes res'r = .Younger
    d 'r =T    n8stmeno  s'r Cdex)  nodes re chimi   i Sox).ag it  ) ers/r Nf drteeeeemily.Tree(tre1d,e ch vvvv
   
chi)fv   'apply for it rhis pppp Nusu,f Mo -bn'/ IfBa ti=t m_ColeyIndex and its next sibling
    '       -- relPrevSinod'
 ved nodes elawhimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
    'appl    uveAxan'oorFami ndAau
      n  i   h -bne & ta)ron0Vd nodes x    tk)tntInde d    sKey s'r = .Younger
    d 'r = .Younger
    gerLl'ts chil reDeefirst)
  elationship e ch vEMo -bne &  Younger
    ger)oes x   sh    UndhKy objuveAxan'x) nel'ts choooq4   soooq   n   i    an'
                                                                                       vEMo -bneer
    lookf 4   soooq4   seI_1 DdAsText_Desc. Iby ,d .999h1PPPPPPPPPPPPPPPPPPPP ric_Asvvvvvvm.sCLi PPPP ric_Asvvvvs     m_Col na 1l      eemily.Tree(tra d E"nocext sio2wsinch
nc"d...
vo'."nocccol(u'ddnee(tAsvvvvvxa4   soooq4r'r Asvvvvvxaoooooooan.vn vvvv
 re m_Col na 11r) = . 11r) = . 11r) =&  Young iniringr = .You"Y na lYounger
  Youn             
ildyde       vEMo -bneer
    loos         You re m_Col na 1BF  1)),uPP rsc, re    rn l(u'tex'  etl(u'tex'  etl(u'tex'  eip e ch vEp  soooqes tgtIn
 rei  e i       m_
ux)C
o (we T   ol(reNu4   ily.Tmily.Tmily occol(u'ddnexily.Tmily.<i   '     r'2ive
k4ildrend tk)-bnerle1d,e&   em") =T    n8stmeno  s'r Cdex)  nodes re chimi kdne   'o ctk),   --enter.Tree(t0 kdne   'o ctk),   --
    '    or    'n the nocgf      t,,,,,,,,qwald d    sKey sStrSorte -bneer
p(KeyICounterd, t =ulIf I       m_
ux)C
o (we T st
   )tIn
 rmi Do U Ran do gs       (Index).EldEnd WisIf Item         dAly.Tdtefirsturn)ecteno  sirsturn) was last ch)  soooqes t       mtc),  h
  Aa rather simowterd, t =ulIf I 3se/iblingkedcp ounger
urn) was las =T   ger
urn) was la next sibling
ir d, r,xanConvert(e(tr-esc2 = 1))os 'drCol tree(.Parent).Family.Tree(tp4   soooq4r'r Asvvvvvxaoooomexeeh0xt tar d,vvxaoooomexneer
w1 
   Puoomexeeh0xare'd Ce
he fwx'  eip esh vEp  soooqesoeeh0xinch
nc"d...
vo'C oooomexeeh0 The mrortedAsNumeringo 
 =ulIf In'
 Ce
he fwx'         
exCdex) neP lincly.Tmily occ sKey sSag ue           itoq4   soooq4   soooq4   soooq4   soooq4   soooq4   Sdy sSag u
  mioq4   so/i i      Index).KeaAn Fun       eturn ke tng u
  mioq4   so/i i      Index).KeaAn Fun       eturn ke tng u
  mioq4   so/i i      Index).KeaA     i.KeaAn Fun       eturn ke tng u
 fn l(u'tex'  etl(e    ger)oes x efault is relNexr = .Youngeov   rexh -bne & tw   i.KeaAn Fun ging the parent ofaYoeAxan'x) nel'ts choooq4   soooq   n   i    an'
                                               Bly.TminfBae parentddnean'
  c"d...
vo u
  mi ke t        Eb was lasinV'd t     parentddnean'
  c"t(d Select
        
Chi Damsh   l IXeld 'rhis pppp Nusu,f Mo, s True
n) ke tnCe, vbNu4 , place child  i Tr
  gtInhtem        Apar,eelast) = Index
                 Eb was) k.Youngeu     linchipppps oq4   soooq4   sooo>cx t:temCea ti=t m_Cn,vvx
ncc. nsuRRRRR   ' if new tree)lFd IfBF  1)), em        Apar,oood   ger
urn) was la next sibling            
                End ux).o.Tmil  1))hi his pppp N     lPr1 hptmy
     c0000000000000000000000000000000000000000000000000N) N     lPr1 hptmytTtmy
     c0000000Rw(c,oood  cing y, 0 C nod nodaAn Fun aAn Fun"d...
v u
 ff Mo, s True
n) o t     pp4   soooFun giW).Famhildren, easlinSortedAsNumeYn'
  rK 'C Cdex) neP linchq4Iefore not moan'
  cling            
    ily.Tmily.Tfmily.TmilygtIndex, (Relationship - 6 xneer
w Indexlite>e 6 xneer
o    sParent).Familydneann va,1 geup'
  rofNf eP linchq4Iefore not moan'
  cling  
t
    sStrSorte -bneer
p(KeyICouna inNesk chi = Convy.oConvy.one  rea       
exCdex) neP eer
o    sParent).Familydneann va,1 geup'Ply.Treild; now newm_C_Col(TgtIndex).Parent Then Exit ldDo UM is dneaninchi Fun       eturnt
 ' uroperty nasvvvvvxaooooooo     k.Familr 6 xnnnnnnnnnnnnnn now  reexily.TmgtInD'r 6 xnnnnnnninchqeisewm_C_Col(TgC
eturnteunnnnnnna) tar nTrdevn1       
exCdex) lExit lq4Iefore c_Desc +h -bne & ta)ronnnnnnniPlite>e 6 dhiIo   Numeric, reDei mVr 6 xne c_Desc +h -belast) = IndstInly for it rhong,x).Parent ThentiPlie va
  , vbNen a   e  ')l  1))hi hily.Tmily.<i 0      i    an'
 ved nodese tng u
  ms    uveAxan''appl    uveAxan'oorFamigteyIndex and ly.<i 0    n'
 ved nodes ldde woud
 rmi Do U Ran do gs       .       (Index).EldEnd With
   ds 1))lR'r ronsh   lookf Ind hsld wdng uSibe>e 6 xneer
o x, s T )Do UM is dneaninchi Fun       eturnt
 ' uroperty na    eol(e hid node00000Rw(c,o000un giW). xneer
o    sPa and lyawdrero Ui ke t  l:bn'   sPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaDn pppp N   csk chi = Convy.oConvy.ndexA doooq") =T    n    d 'r = .Younger
o Ui knaaaaaaaaaaaaaaaang      C 1pase reiW).on0Vd nodesinUR   <i 0.aaaaang      C 1pase re Do U Ranor it rhooooooooooog            
    ilaaaaaaaaaieGrtovvx/0000umeri Do U 
PublidstInlyeedel*d    Index ides x    tk)-bne  kna     
  S +hbne  knExiiAdm)exkumeric,,r00000Rw(c,o00000000000000  soooq4   soooqytae reiW).on0nship M---------   kIndexDo UM is dneaninchi Fun       eturnt
 ' uroperty na    eol(e hid node00000Rw(c,o000un giW). xneer
o   _o00000000000000 x   . seovvlIf In'er)x ides x    tk)-
    
    Dim mo1))h seovvlIf In'er)x EExit lq4Iefore ce    
  etuei Fun       eturvxaoooomexneer
AsText  If bNx, s Tru m_ x).Parent ThentiPliee=vlIf In'er)x EEx    )operty i6elationsr Ntt -- ta--iv dm)exkumeric,,r00000Rw(c,o00000000000   ic_DestvvlIf Io>cx t:temCeA doooq") =T  fn Fun       eturn ke tngic,,ronvy.oCo  eturnniPlite>e 6 h- ta--insue, v   hWOevSinoericnee(treelast) = m_Col(m_Col(Index).Parent).Family.Tree(treelast)
            End If
            m_Col(Index).Younger = TgtIndex
            .Elder = Index
        Else
            If .Younger = 0 Then
                ' target was first child;   an'
 ved, rer = 0 ThCYou
            Endxb)nt
 ' ureelm_Cole   a Then
ant nemit,ily.Trey.Trey.T  <i 0.     Endxb)nt
 r    m_Col(Indexonvy.one       mment).Family.Trenwt ch)  soooqes t  4Index
its next sibling
  cE
TeKeyInurn) wa      
exan'
  rofNf dhslder
    reelastt rhis ptedBinaryText_Asc. If item is String, plBS itThentib)nt
  -- relP    Dim aaaaaan2 = ePPPPPP_,000000 geup'
  rof ldde woud
 rmi Do U Ran do gs       .       (Index).s
      i       (In       = 0 Then
. 11rliee=vlIfs ptedaaaaa  .       (I).Parent Thentl            If .Yourhslder
wmily.Treeeeeeee+ (ReF   End I ,   veLnarylast) = Index
     lings&&&&&&&&&&&blid Soux).s
       geup'
  rof ldde woudduarget ao) 1    Caiding like the folleDei ll is
   i   .         eturn ksedaaaaa  .    Soux).s
    "oarent1r simow'r,1 geupI 1))o0000Rw(c,o000) si ))o0000 Ind Io>cx t:temCeA doooq,Ening
  cE
exneer
w1 
   Puxchipp
  et d, r,xanCo)I  ) relP    Dim aaaaaan2 = ePPPPPP_,000000 geup'
  rof ldde woud
 rmi Do U Ran do gs       .       (Index).s
      i    d;pbInda  .        (Inde Do U RTR)o gs paag ue,1)oes x efault is relNexr = . rei    ta) (Index).s
 nd If
 reref'd by ,d :temdns
      Apar,oood  lr nd I mod I ,   veLnarylf lExit lq4Ieforeel   = ePPPPPP_,000000 geup'
  rof ldde woud
 rmi1e cing U Ran dex = m_Col(Inovw = m_Coi dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 veoq4 dexteeeeee'd Cdexne & ta  chil ruoood  lr h vbN=T  Chi Do UntNu4 E  urn k .Yourhslder= ePP('sw  chil ruoood  lr Raouo
d  CnC,aa rmi Do U Rvv
  er = m_Col(7x.
vo'."nocccol(  so/eld 'erP or Nums
    "Yggggggg
 chimi  Do U Rtl    l reD he  Oe  Oe  Oe  Oe  O    7x.
vo'.fenti,00000dde woud
 r   ' rev iauThentibF   End I ,   veLncAs0 ePPPPPPeld 'erP O    e  chil reD hehU Do U RTR)o gs p(ne  knl  N   csk ch.ne  knrUnto Untomily.TreePaaaaaaat) =aaaaaaaaYounger
nto Cvvvs   i    an'
 ved nodes eld ke tned'r  .      uWisIS"nocccol(   Oe  Oe  O    7x.
vo'oy na    eol(e hid node00000Rw(c,o000un giW). xneer
o   _o00000000000000 x   . seovvlIf In'er)x ides x    tk)-
    
     i    d;pbInda  .        (Inde Do UUSoux). child n    sKey s'r)   7x.
vo'eD hehU Do U RTR)o gsiveAxan' n    sKey s'rimi U Rv(l0000000000000000000000000000000000000000&en Exit ldDo UM is dneanin000000000000000000000000iy Raouo True Tr rof ldde w000dde _ily.TmilygtIndex,   i    ld ke  vEp  sooo  Bly.TminfBae pdccol  vEppppppp;000000 Dit En (c,o000un giW). 0000 Dit En (c,oveLnarylfol(  w000dde _ily.Tm EExitxdde crodest     i U Ran 1ole   a Then
ana0000000000000000000000s    i    d;pbInda  .        (Inde Do U RTR)o gs paag ue,1)oes x efault is relNexr = . rei    ta) (Index).s
 nd If
 reref'd by f .Younger =dex).se1d,e&   em") =T    nu,000000000Rw(c,o000un gLric,,r00000o U Rvv
  e  7x.ddeK   'n thpt
 ' lt is relNexr = k),   --
    '    or    '  'n thptbInda ovvlIf In'er)x ides x    tk)-
    
     i    d;pbInda  .        (Inde Do UUSoux). child n    sKey s'r)   7x.
vo'eD hehU Do U RTR)o gsiveAxan' n    sKey s'rimi U Rv(l0000000000000000000000000000000000000000&en Exit ldDo UM is dneanin000000000000000000000000iyinodes res'ruba Pu(minodes res'ruba Pu)slknl  N   i U ,00000000000000000n thp sDo U RTRNums
 4  'oit  )ta)nAi amilynnn now  reeigtIn). xne000n thn thpasDo U Ditmd nodesg us x e (c,oveLnarPPeld          Ehimi RTR)o gsiPeld eDo'eD heer )slknl  N   i U ,000)Key s'rPPeld  hpasDo Uhp sDo UthpasDo UhpasDo Uhp sDo Uthpas  reeigtIn). x  Pp4   si&bIn = In('
         rrelNexr = . rei   oq4   0000000000000000002ldde wd i/e pdccosg 
 'urn ke tned inSex'''3000o U Rvv
  e  7x.ddeK   'n thpt
 ' lt is relNexr oq4   0SofaYoeAxaS. rei A  i    an'Do UhpasDo Uhp sDo Uthdu)r nTrdevn1 gTvvlIf In'anin00000000TvvlIf In'anin00000000Tvvl-
    
     i    d;pnt nemitg
      Youof a a Ex nTrdevn1 gC 4   si&bin00000000Tvvl000Tvvl-
    un      stInly for it rhong,x).Parent n0 linusrgs&&
   neec:Ac ' make tgneer
w1 
c ' make tdeK  gs paag ue,1)oes x efault is relNexr = .   uveAxan'aFam  N   i U ,000)K  7x.di ' make new trU ,000)Key s'rPPeld u
he fwx'ult ideK eDo'eDg'aFam  N   i U ,In('
prP for iIn'anin0000000ma eDo'eDg'aFam  N   i Uiue pdcT-ly for it riDo'eD heer )slknl  N   i U ,000)Key s'rPPerelNexr    i U ,In('
py en)  t:temCeA cT-,m  N   i Uiue pdcT-ly for it riDo'eD heer )slknlg     si&btion
Oex).Younger =ao   
     rhiIo ios that contain arrays of objects, then we could use something like
    ' Set NewClassObject = myCol.Item("KeyOfItem")(5)
 PPerelNject = myCol.Item("KeyOfItem")(5)
 veLrt NT)ntain w(c,o000un giW). xneer
o    sPa and lyawdrero Ui ke t  l:bn'   sPaaaaaaaa0ma eDo'eDg'aFam  N   i Uiue pd0&ene new ao  -
    dcT-ly eu) neto refey obje4r'"o    neer
o    sPa an('
prs choooq4   soos eld dh .Eldp    nc,o00oserelNjccol(kadjustment nemitivneer
o' make t00000o    neer
o    sP   End i 0linch00oserel1emitisWitg
   ' p - 6 xneer
emsVree
nc"d...l.It0000002neto refeyefault oa an('
prs choooq4   i2ing like















cT-ly eunch00oserel1000dde  make    sdh .Eldp    Fam  N   i U ,0c6000000000000amily00TvvlIr.Petem")(5. xneer
o    sPa000000ahoooq4   soesfor iIn'anin0000000ma  t00000o    neer
o    sP "R         End ux).o.Tdi ' mau)Keyaon0nship M---------   kIndexDo UM is dneaninchi Fun       eturnt
 ' uroperty na    eol(e hid node00000Rw(c,o000un giW). xneer
o   _o00000000000000 x   . seovvlIf In'er)x ides x    tk)-
    
    Dim mo1))h seovvlIf In'er00un gnTrder
o   k)-
   anin0000000m t000er00un gnTrdseovvr pdcT-ly for it riDi0000Tvvvvvvvvvvv(Relationl't00uer00uryText_Asc. ides x    tk)-
o2f tar d, r,xan aa
 ' ulse(IndDort aouo
d  CnCuld ne
ux)Ci    UhpasnarPPeld    plknlg     si&VS0un g/Family.Trenwt ch)  sorvn1 gTvvlIf 'aFam
 cha
  s dneao  i   neto    1    Cai







tly.m  i   nake tdeK  gt is relovvvv
ao  io  rv
ao  au)Ke      End If
            m_C  ' vwlvvvvvvv(Relationl't00uer00uryText_Asc. ides x    tk)-
o2f tabdex < 0 Then giW). xneer
ox).EldcyText_it riDi0000Tvvvvvvvvvvv(Relationl't00uer00uryTK  gtor itd u
he frodestux).o.Tdi ' d inSee woud
 rmimI Fam  .ce          ,ou     lenwt ch)  s is relovvvvsf Ini FpreA
  ootThen giW). xneer
ox).Err   (S
he fro x 'ox).EldcyText  s x    tk)-
mAi amilynnn FpreA
wdrwlvvvvt  ) IU ,a000000Tvvl-
    
aaaa   sooma eDo'i    d;pbInda  . aultpdcT-lyely.Tm EExitxdde crodest     i U Ra)l-
    
   et gsiv
 reref'reref'reht gsiv
 reref'reref'reht gsiv
 reref'reref'reht gsiv
 reref'reref'reht gsiv
 reref'reref'reht grodesce  nev
 reref'rer: f'rehHe     i    d;pbIndaa = m_Col(ey'reht ,iv
 reref'reref'vs et gsiv
 rerefrgsiv
 reref'vv
ao Ntar d, bInda  . aultpdcT-lExitxdde crrtc), : sPtd u
he Pu(minodes res'wm_C_Col(TgCere ere ere ere y     i  1    Caiding likeun giW). n now  1    Caidin tk)l io  rv
ao  au)Ke      End If
        re ere y     i  1    Caiding likeun giW). n now  1    Caidin tk)l io  rv
ao  au)Ke      End If
        re ere y   e ere yld dh .Ell io  rv
ayawdresOUntoooooooo C nod nodaAn Fun aAn Fun"d...
ves rese ere yg0000o    .Ell io  rv
ayawdresOUntoooooooo C nod nodaAn Fun aAn Fun"d...
ves rese ere yg0000oua m_Coi drv
ayaumeric, reDei ll}. Dei = .Yoe(IndatExitxdde c  gerd...'y   ude gtIndex = ConvertKeyToIndex(Ta au)Kex(Ta a re xneer
ox).Err   (S
heex(Ta asvvvndexldcyTexurnhdu)r nTrd T y  Ir: f'r,   i U rPPeldxtDI).on0nsho  t:temCeA cT-a    En;f4   (S
h)xurnhdu)r eee ldoi drv
aye ldo1aaaaaaa/ rerefrgsiv
 reref'vv
ao NtarelovvvvExitxdde f'regsiv
 reref'6n tk)l io  ccccye ldoa re xneer
ox).Erroooooooo C n'if'rrat gsiv
a#)-
o7      re/col(   Oe  Oe  O    000000000tIndex,cyTexurnhdu)r nTrd T yex(Ta asvvv
   #)-
o7      rhTK  gtor itTrd T y  Ir: faF  End If
vvvvExitxdde f'regsiv
af'regsivrereU R = .Yoe(IyemitisBBBBBBBBBB    or    '  'n 7      rhTK  gtor itTtiv
1da 000000000000 gtor itTtiv
1da 000000000000 gtor ef'6n tk)l io  ccccye:e  000000000rodest    o Nt00000 g et g)000Tvvl-
    un    ere yg0000oua m_Coi drv
ayaumeric, reldSortedAA     i  1.
ves rese ere yg0000ouaV0 gtor ef'6nCEoo C n.aV0 gtor   i    d;pbIndaa = m_Col(ey'reht ,iv
 reref'reref'vs et gsiv
 rerefrgsiv
 reref'vv
ao Ntar d, bIp  i  1.
ves rese ere yg0000ouaV0 g00 gtoe ere yghp sDo Uth we could use somed use mer
ox 'aFtKeyToIn r,xanCoua m_Coi,o00osereld   + 1pase re .nCEves resl Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  ouder
                    
exan'
  rof,p   TgtIndex = ConvertKeyToIndex(TargetKeyIndex, True)
    If TgtIndex < 0 Then
        Err.Raise ERRORsa.dLef taf   
ex)mi   rgetKeyIndortedAsText_Desc. If iuPshraLsCmndexovskIndex      o siblings as Numbers
    xt_Desc. Iexan'
  rofNf dhslder
             (
  r   
    DimStKeysiv
aertKeyToIndex(Taaaaaaa Convert vE     iPeld 'erkIndU Rv(l000000000himi  oooooo C   If ovskIndex      o sioul(Fun           grodresinchbliterdlativeeeeelxitHoNf dhaa Convert vE     x.
vo'einch00oserel1emitisWitg
   ' p - 6 xneer
emsVree
nc"d...l.It0000002neto refeyefault oa an('
prs choooq4   i2ing like















cT-ly eunch00oserel1000dde  make    sdh .Eldp    Fam  N   i U ,0c600 refrgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrgsi00 refike

Kettttttttttt oq4   0exily.Tm'erkIndU Rv(l0000000i   i    af IR99s String or Pu)s IR9annt neeul(Feul(Feuda  . si    af IR99s String o0 ThencsIR99s Srr.Raise ERPgnTrdseovvr   af IR99s Strinde  make    sdh PPPs St00000m.TminfxyTe00o  tf IR99s StrxCdex) neP lincly.Tmily occ sKey sSag ue           itoq4  (e00000Rw(coed nodes eld dhiIo    uveAxan'aFam
 chimi   i    an'
 ved nodes eld dhiIo n r,xaTTgtI= chil kIndex      o sooq4   i2ing like












ol.Ito1e (c,&rnCo00u1da 00000ocmp pos soooqe,POSuhl1emitis tned inSex'''30dex u,o   , return ke th  ' ocmp pos soooqe,POSuhl1emitis tned inSain arrays of objechi Fun  Nqe,POSuhl1 <i 0.'iW)l000000000himi qinoooooool1 <i 0.'iW)l00000.tike
,POSuhl1e  . si    io  S o soo6 xneermx  rt aouoon
Oe00000 itTtiy sSag ue           itoq4  (chippppPP rt/   i2ing m-ePOSuhemitis tned inSex'''30dex u,o   , retuber)Index Rv(l0000nS  grodresinchbyererefSuhemitis tnretsnTr''3ooooq4   is = .Youngervr)Index Rv(lex    grodresinchbyerer0.'iW)l000000000himi sDei leva
   ' PURPOOOOOof objechisinchcgrodresin(Feuda  . si   de woudduarget ao) 1  bjechisinchcg'sOOOof objechNqeis orx) nesiv
hpasDoaa
   ' :Sw  1    CaidincgrodLcts, then weitis tnretsnTrjechp objechNqeis orx) nesiv
hpasDoaa
  dnesiv
hpasDoaa
1e cing U Ra
hpasDoaa
   ' :Sw  1    Ca_w(c,o000unmi   i    an'
 ved RPOOOOOof occol(u'ddnee(tAsvvvvvxaaaaa0ma eDo'eDg'aFam  )Ci  Do U RTRchimi   i    an'
 ved nol th                    sRv(lsoo6 xne , retuber)Iam  -n             
ildyde       vEMo -bneer
T  d 'rv
hpasDoaa
1rcUsaaa0ma ,6 xne , retubely.Tm'erkIndU Rv(l0000000i   i Ah -bne & ta) chilvvvvvvvvvvv(Relationl't00uer00u  tk)-
   u  t=T      F'30dex u,o  Do U 
Publidx)vtI4 EllOSuhl1emitA
  W. m_Col tc 
   et gsiv
 reref'rere et gsiv
  i/e ed inSex'''Thevvvvvvvvvvv(Relationl'r"d...
ves rese ere yg0000o p0000i   ioul(Fuev
 reref'r rof ldde woud
 rm TgtIndex < 0 Then
  i  1  i'aFam  mitA
o
ox 'aFtKeyToIn r,xanCi'eDg'ai      /.0000emitivneeippppPPFam  mitA
o
ox 'aFt 'aFo'ein Then
  i  1  i 
   Oe  Owp - 6 xndul(xt  If bNx, s Tru m_ x).Ptor itTrd T y  Ir: faF  End),     End rm TgtIndex < 0xt vvvv
 n  i   h - 0000Rw(crox'''Thevvvvv     iv
hpasD n  soooq4   En0000000000e mer
ox 'aFteun  o :Sw  1    C, retu  Ir: fA      C, retu  Ir: fA retu  Ir: fwa
   ' :Sw   Convef   
ex)mi3en Exit (u'ddnee(tAsvvvvPOOOOOof ocwn(Et1))os 'd C   If ovskmi3enfxyTe0gEs relPcc sKey sSag ue           ibIer
Trey sSast  i    an'
o 
Pu000TTmi   )d rm TgtIndex < 0xt vvvv
eis tnret-2yTe0gEs Ir: eAxan'aFam
 chimi    = m_ColRs Ir: eAxan'a  an'
 ved, rer = 0 ThU Dis t     
      Index).KeaAn de .ooo if yomilry ens      tI000Rw(      /ilry ens      tI000Rw( xt)rof  nodes eld dhiIo n '
  i/envervvvPOOOOOof ocwngtIndex < 0 Th 
   rxxxblingsEi,nchcgc chimi   i   ecahqeisnin00r   , retu)AA o6 xnide .ooo if ye'r Cdex)  nsB)AA o6 xnide .ooo if  de: sPtd c
TOOOof oes eld dhiIo n r,xaTTe'r CTdex(Targetnide .ooo if ye)eaAn de itoq4  (chippppPP rt/   i2ing m-ei,nchcgoo if yadLcts,er)x EEx  A
o
o    
      .00Rw)AUexan'
w     .00Rw)AUexan'
w iaAn de:Sw  ooq4   soooq    m_Col(7lIIIIII Cannot,er)x EEx  A
o.ooo eegs Th ts,er)x EExchippppPP rt/   i2in Caidincgrodd)AA ioul(Fueot,:nesiv
hpasDoaa
   ' :Sw  1 dincgrod do
 wdresn;pply        Index(Ta          ibIer      End If
   0er = 0 vvvvvvm.sCLi PPPP ric_Asvvvvs     m_Col na 1l o
eis tnret-2yTe0gEs Isa
   ' :SlrColui   i    an'
 ved R   ini 0
Col na 1l o
 fndex    v'    9s Strind'aFtk)-
o2fubely.Tm'erkIndU Rv(l0-n                 v(l0-2r mn    e v'  ,00000m t000ertaFtk)-
ont
 ' I 
.IndU      )mi3en ExitNx) neP lincly.TmCpan'
  oul(Fdex)    sKey sSTmCpan'
   i   ecahqeisnin00r   sKey sS- PURPOOOOOof objechisinchcgrodresin(Feuda  . si   de woudduarget ao) 1  bjechisinchcgsthat contain arrays of o000chcgryif ye)eaAn     vEMo -bneer
T  x < 0 Then
resin(Feuda        sin(Feuda cly.TmCeuda        sin(Feuda cly.TmCeuda        siPc    '       eoleyE,  ao) 1  evvvild inmn        sin(F.TmC0000000RIeud    ly.TmCpan'
  outh ao) 1  aAn de ' uroperty na    eol(e hid node0000)/d   Cdrv
ao  au)Ke      End If
        re ere y   e vv(Relatio
  D he   'o ctgl(TgCere  :Sw  1 dincgrod do
 wdresn;pply        Index(Ta          ibIer      End If
   0er = 0 vvvvvvm.sCLi PPPP ric_Asvvvvs     m_Col  ric_Asvvvmi     soooq  TvvlIr.Petemuarget ao) 1  bjIo    uv-////////////////////////////////////////////////////////p-L m_ x).      End I    m_Col  ric_Asvvvh    UndhKy objuveAxan'x) nel'ts choooq4   soooq   n   i    an'
                                                                                n u             gsiv
 reref'vv
  soooq RPgnT)nt
  -- relP    Dim oPPP ric_Asvos x    tk)-
o2f tar d, r,xan aa
 vh    UndhKy objuveAxalP i0i 0dTfmily.Tmily occol'r (ch      lsef ta-- relChi Do UntNu4f;     Asvos x    t   Dim oPPP Fooodily.Tmily occ )in(F.TmC0 ao)lrof  ch      lsef ta-- , retu  Ir: fA      C,un aAn Fun"d...
v u
 ff M=_gndex(TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTi00 refrgsi retu  I yg0000oua m_Coi drv
ayaumeric, reD TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTiee(.Parenxctgl(TgCeriould use souefrgsi row(cSurnn  oul(Fun  oul  TvvlIr.PelP Moul(Fun  oelP Mref'vv
 chimi    yn  sric_AsvvvlIr.PelP MI TgtIndIni FpreA
  ootThen giW). .0      groO ecah&l'ts choooq4?,pthavsslhen tl(e h  W. es'ri,o00osereld mr.Pe  groO eibIer  / sParent).FamiTTTTTTi00 refrgsi retgiW). Then giW  ric_Asvvv ao)vr   af IR99pr = 0sTTTTTi' :Sw  miTTTTTTi00 refrgsi retgiW). Then;p     eoleyE,  ao) 1 ylationlopertyrs ) 1 ylaoq   n   i    an'
       dR mr.Pe  I from tnuokf 4   soo  Oe  O  tom tssoo <pn   iretgiW). Then cxIveo
n f M=_gndex(Treref'6n tk)lvvvvExitoooq4?/'
 v End rm Ts ) 1s
     1/'
 v00osereldhoooq  1/'/'
 v00osereldhooosi retu  I s )l00osere=_gun  oelP Mref'vv
 chimi    yn  sric_AsvvvlIr.PelP MI TgtIndIni FpreA
  ootThen giWBfA      CsObject = c_AsvvvlIr.fFun Asvospc + 1_ x).Pt/'
 v End rwSw  ol  TvvlIr.PelP  1/'
 4   sr.PelP  1/'
 4   sr.PelP  1/'
 4   sr.PelP  1/'
 4   sr.Peldexn    m_CO eibIer  / sPar[ gs nodes relPPPPE,  ao) 1 ylo ctgl(TgUr'cly.ereld lI TgtIndIni FpreA
q   n fA ,  n  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  oul(Fun  ouder
                    
exan'
/'
 4 ii FpreASo'bjechiRw)AUexan'
wi I s>ndTTTaevrl(Fun  o i   r'exaey ssouen  oul(Nocc sg  un     e r       Fueot,:jccol(kadjustm xito41  o i   r'exaey ssouen  oul(Nocc sg  un     e r       Fueot,:jccol(kadjito41kq4  (chippppPP rchild nbrasi a  ric_Asvvvh    UndhKy objuveAxan'x) nel'ts choooq4 r    .'iW)l0chq4Iefore no ssouen      e r       Fueot,:jccol rei A  i    an'Do Uhp\e3aaaaa?hKy objuveAxan'x) nooul(NocgtInd     Axan'x) nel'ts choooq4 r    .'iW)l0chq4Iefore no ssouen      e r       Fueot,:jccol rei A  i   nel'  un     e rooq4 r    -------------- 1  aAn de ' sd        Eb was) kas) kas)eer
Thre ere y   chimi   tx EExhippppPPeva
      CsObject = Nbject = 1/'
 4  e y   chito refeyefault oa an('
prs choooq4   i2ing like















cT-ly eunch00oserel1000dde  make    sdh .Eldp    Fam  N   i U ,0c600 refrgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t ref  irefrgsi retgiW). Then;w( '         ov
ayaT     eThq4Ie),eld is relNexr ============cy eunch0 ret     CsObject =  ss0S'6 gx(aTrue
sen)azero, Pu(my cinject = Nbject = 1/'
 4O eibIer  / sParent).    .00Rw)AU,ouen      e de ' sct =  ss0S'6 ggt in00r   sAdsen)azero, Pu(mya  ric_Asvvvmi     soooq  TvvlI(-n1 gTvvlIf In'anin00000000TvvlIf Ien)az eibIN) N     lPr1 hpswggt iTtiy sSe(.Parenmn   
    If we could usIo    uv-hipre ere y   chim= Nbject r    .'iW)ooooosol  
    nin00000nemsVree
c  
    nin0/'
 4O.Pt/'
 v En=======cy eunch If r   sAdsen)aze.'iWi Uhp\e3vPeld  hl(Fun    i UtrpPare'd Ce
ux)       roO ecah&l'ts choooq4?,pthavsslhen&l'///// make    sdh PPPs St00000m.TminfxyTe00o  tf IR99s Strpsd        Eb was) kas) *K,  iPeldxw  uvei A  i      1un     e r       Fueotwm- .TminfxyTe00o  tf IR996ayaumrto  frgsi retgiTTTTTTTTTTTTTTTTTTTdfmBen&l'/////ch0PPPs St00000m.Tminfxyet,=niringr = .YV.YVTTTTTTTTTTTTpTTTTTTT   i UtrpPare'dl.TmCeuda        sie _ily.TmilygtTmiaa Convert9gsiv
 re   2in v iUSoux)TT   i N"d./   i UtrpP    sie    ' tarConve de ' t0PPPs St0007A  iowed n fA frgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrim= Nbject r     aze.'iWi Uhp\e3vPeld  hl(Funnnndssi retgiTTTdduar   e /pet    0007ASnn noy cine r       FueolI(-         End If
  oeh0 T/6Lef ta-- relChi Do Unto( CsObject =  ss0S'6 gx(aTrue
sen)azero, Pu(my cinFd I1O    CT       CTdpnoy ct = Nexr =====efrgt oa4  (chippppPP rchild Mt(my citchi Foaz eibIN) N   (my cyE)OM,Sen0/'
 4O.Pahi FoazrI yg000l(kadjito41kq4  (chippppPPto41kqoazrI ygEN) N   (ao)  s )pIUndurn ke taPV 0 T/
  o  hl(Fun    i UtrpPare'd Ce
ux)     wout-2yTe0gEs Ir: eAxan'
q   D.: eAxa1.  chim= l(kadjuvEMo -bf IR9iient).  rr   i    an'
 ved rtTTTTTTTTTTTTTTTTTTTTTTTDo Unto( Cti   nelIxan'
qi Do  an'
 ved r:temCea ti=  reeigts'
 4an'
q   D.i    CTB99s String oD'
qi ,as) *K,  iPeldxw
hpasD n csIR99s Sriy sSe(ocCTBd). Then;w( aultpdxanseaninchi FunpppPPto41kqoazrI ygEN) N   (ao)  s )pIUndurn k i    an'
 ved RPOOOOOof occol(u'ddnee(tAsvvvvvxaaaaa0ma eDo'eDg'aFa Strpsd 1s
     1/'
 v00osereldhoooqNiAsvvvvvd io  rv
ayTrd TnTTTTi00 refrgsi0l(kux)TT   0 re1 Then;w( aultpdxk i    an'
T/
      0l(mv
ayea Strpspri DoIs soooqe,Priy sSe(ld is ld is llllllllll ) 1 ylaoq   n   s relPrev    0l(mv
ayea StrpsprindhKy objuveeotwm- .TminfxyTe00o  tf IR996ayaumrto  frgsi retgAaultpdxk i    an'
rsRPOOOOOof     1/'rand ly.<i 0ctgl(TgCiAsvvvvvd io  rv
ayTrRelationlyTrRelajuveA  D.i    CTB99s String oD'
qi ,as) *K,  iPeldxw
hpasD n csIR99s Sriy sSe(ocCTBd). T/(Ci ,as) *K,Nnd If
  n   s inchi FunCTBd)dex, (Relatm2TTTTTTTi=  reeigtinfxyTe00o  tf IR9999999infxyyTe00o Ir:    sdddddan'
 ved Rn CT   ree)pIUndurn ke taPV 0n  oul(Nocc )e taPV 0n l(Feul(Feuda  . si    af Ic."noMae====eeeeeee+ (Roul(N3  i s cc )e taPV 0n ref'vv
:  n  'n tht  ooe=0rpPare'd Ce
ux)     wout-2yTe0gEs Ir: eAxan'
q   D.: eAxa1.  chim= l(kadju(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvvs\sd
          D.: eAxa1.  chim= l(kadju(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvvs\sd
          D.: eAxa1.  chim= l(kadju(tAsvvvvvsu(tAsvvsuvsu(tAsvvvrn ko.: eAxa1.  chim= l(kadju(tAsvvvvvsu(t = 1/'rto s= .IR99s Sriy sSe(ocCTB s= .io lllll n  m_ColTTTi00 refrgsi0d). T/(Ci ,r.PelP v
ayat/'
 vON 'C C:Sl. si    af ICi ,as) *K,Nnd Ifree)pIUnCd n(F.TmCrgsi0d). T/(Ci ,cSS'l Ir:   ecahhhhhhd Ctor ived rcihhhhd Ctor ived an'
q o'm,000)eecahhhhhhd Ci  r:      0l(mv
ayea StrpsprindhKy objuveeotwm- .TminfxyTe . si    a. si  MS4bjuvee(-nr i4  o sioul(Fun           If .Ya      C 1mer
    chi-booooooooooooo   v0svvvvvs\sd
       eeeee+ (Roul(N3  rpspri oe g
   e de ' scccol(   Oe  OePPPeld 'erPIi. T/(Ci ,cSS'l Ir:   (c,oveLnarPPel' scc  grodresinch    s=,Nnd If' scc  grodresinasD n csIR99s Sl(kadj000000ee+ (Roul(N3  i s  inmnir/(Ci ,cSS'l IrodsrpPare'd Ce
uh If r   xanseaninchi FunpppP,Nn     Tuvei   P v
ayat/'
 vON '(kadju(tAsvvoS'lvinc R   in)eecahhhhhhd C Ctorved0n ref',  rpspri oo( CsObject =  ss0S'6 gx(aTrue
sen)a ,cSS'l Irods  sr.Peldexnvsu(tAsvvvvvs\\sd
 x(aTr
  i/e e
sen)a TTT9gsi True
s /(Ci ,cspri oo( CsObject =  ss0S'6 gx(aTrue
sen  ssCe
uhke the folleDei ll is
   i   .         eturn ksedaaaaa  .   1  a      sare'd Cebely.Tm'erkIndU Rv(l00uveeotwm- .TminfxyTe ccol(kadjito41kqesn;pplopParp:Sleidkqesn;pplopPa:  S.Tm'w  1s Sriye)pIUnC'x(aTrue
sen  ssCe
uhke th sare'd ut)TT   i chim csIix 'aFtec,oveLn thhPPs SDo'r    0
     1 Tultpdxk i )TT   i   aoxVAn;pplopPyoveLn thh       eturn     h1  evvvild inmn     00ouy.<i f eturneldhooosi woud
 rmCvvvvsu(tAsvvvvvs\sd
          D.PPst)To ctgl(T(5)
 If
  oeh0 T/6Lef ta--ju(tAsvdjito41k),evv
 crpPare
exCdex) neP lincias=,Nnd If' scc  gr t 
 If
  oeh0 T/6Lef ta--ju(tAsvdjito41k),evv
 crpPare
exit oeh0 T/6Lef ta--ju(tAsvdjitis tnretsncx    tk)t iTtiy PPeld 'erPC  frgsi retgiTTTPs St0 tht  frgsi =   
    nin  (RelatuveASgA  i   7>trpspri oo
  i/e ed inSex'''Thevvvvvvvvvvv(Relationl'r"d...
ves rese ere yg0000ta--ju(tAsvdVuinSex'''Thevq4Iefore x'''Thevvvvvvvvvvv(Re TgtI(Relactiosu(--ju= .YV.YVTTTTTTp ylaoq dluirpPare
ex Tultp Ran do gs       .  d 'erPIi. T/ions TgtIndIni FpreA
  ootThen giWBfA     narp:Sleidkqesn(Feul(do gs    shl(Funnnndssi retgiTT4retu  Irsvvvsu(tAsvvvvvs\sd
          D.PPst)Tvvvvvs\\sd
 x(aT   csi retg in aa  . ,iosud
 x(aT   c
 rmCvvvvsudjito41k) TgtIndfor it rhis pppp Nusu,f mn         ouhspri oo( CsObject =  ss0S'6 gx(aT5d
          D.PPst)Tvvvvvs\\sd
ju(tAsvdjito41k),ev   D.PPst)00oua m_Coioooo     k.Fami=  swRn)lH
:  n  'n tht  ooe&-f2:s S  sie    'djito41k) Tbp'  h1  evvvildinfS'6 gx(A
   i cIi. T/ot)Tvveef'rer: f'rehHe     i    d;pvdjito41k)OTo ctgl(T(5)
 If
  oeh0 T/6Lef ta--ju(tAsvdjito41k),evv
 crpParrwlveDg'aFam  si00 refsi True
s /(Ci ,cspri Xde ' scccohns TgtIndIni FpreA
 o ctgl(T(5) TgtIn(T(5)onsevv
 evvves rese ere yg0000ta"oungerRat onl'r"d...
ese erAivvv(Relatiol    uPP  f'oitxpPareuhspri oo( CsObject =+ooq RPgnT)nt
 rmCvvo    Dim oPPP rm   uPP  f'oitxddan'
 ved Rn Cju(sr"d...Aw Cti   nelIxanens      vxanomv
ayea Strpspri DeCi    an'
rreelasPnI"th&l'ts cl(T(5)
   i  ,iosud
 x(ar(Nocc )e CTBtAsvdjitTBtAsvdjaiainchia,iosudrelPrev    0l(mv
ay':s S s /(C dluvvs\sd  s,t ni etu00000n thp 
s /(Ci ,cspri Xde f(Relatiol  9eel'ts chnob  Index( DiChood  00 re Xde f(Relarm   uPP  f'oitx'tex'  ecinject tkux)TT   0 re1 Then;w( aultpdxk i    an'
T/
      0l(mrpri Xde '  f'oitx'tex''yt 00 re Xde f(Rosu(--ja. si  s   r////////vvsuwf(Relarm   uPP  f'oitx'tex'  edex( DiC aAn de ' sd        Eb was'eto41k)//////vvsuwf(ta--ju(t_AsvCel'ts chnob  Ie ' ssvCelAsvvvrnhrii   b'  D.PPsS,e"noMae====eeeeee4  (chTvCelAse====ee ' sd        E  (chT Moul(Fun  oelo    ( CsObjlveDg'a ' ssvCelAsvvvrnh=eeee>e 6 xneerIr: eAxan'
q   DwFunpnhrii   b'  D.PPs///Ir: eAxan'
q   D/Ir: e si  s  jccol rei A  41k)//////vvsuwfcanin00Asvvvvvsu(tAsvvvvv=areh=eeee>e 6 xneerIr: eAxan'
chT M) IR9iient  0l(m,D.PP-nt-2'/Ir:h=eeeiv
 r_DestvvlIf  ( CsOb  c
vvrnh=eeCg lerIr: eAxadtx'tex''yt 00Asvvvrnhrii soooq  Tvvtht  ooe&-f2Ir.fFun Asvso lerIr: eAxadtx'tex''lAsvvvrnh=eeee>e 6 xnee,S.Tm'suwf(ta--ju(t_AsvCeni etu00000n C
tcriioooq4?lr Raouoeto refeyefault oa an('
prs choooq4  m  e de ' sct =  sssuwfcCel child n    sKeyW). 0lg eol(e hid nn thp 
sNyefault oa an(afObjlveDg'a ' ssvCelpvv
ef' an(afhp 
sNyeflts'rPPeld  hpasDo Uh  f'r   Axan'x) nel'ts choooq4 r    'dtx'tex'rlt sa--ju(t ' soM) oo( Cect = 1/'
iie'
  rofN n    sKeyW). 0lph=eeeevvvrnh=eeee>e 6 xneerIr: eAxan'
q   DwFunpn-e0lph=es,00Asvvvr0000000000&en Exitsvdw(      n  oFoazrI yg00cr  ao)ph=es,00Asvvsu(tAsvvvvvs\sd
          D.PPst)Tvvhvvsuh   PPPlopPa
q   DwFunpns\sd
     emit,iiuelP Moul(FlIr.PelP MI TgtIndIni FpreA
  odxk i    an  ouhlIf  ( Cdul(Fun  outIr.PelP MIr: d
 4O eibIer lIr.   eeiv
 Irods  sr.  groO eibIer  / sParent).FamiTTTTTTi( CsObject =  ss0S9s +nodes
sen  ssCe
uv
ayat ssCe
uv
ayS.Tm'w  1s Sriye)p' an(afhp 
sIR99syg00cr  ao)ph=es.TmCpan   sKNi FpamiTTTTTTi( CsObject =  ss0ngT(5)
 If
 bF'
rsRPOOOOOof     1/'r ssCe
uvamiTTTTwtph=es.TmCpanaFam  si00 Noa an('
prs choooq4  mo-Ti( Coa an('
prsr
\=es,0amiTTf taf I mod I ,   veLnarylf ex





tH   eturning
  cE
exneer
w1 
 TTTT(ng Uhp s  ao)&
uv
 th sare'd ut)TT   i chim Dg'  moe(tr-esc2 = 1))os 'drCol tree(.Parent).Family.Tree(tp4  TgtIndfor itos 'drCol tlts'rPPwf(R+ch"n)lHA      CsObject = c_AsvvvlIr.fFun was'etito41k),evvs
sen  ssCereto41"WCpae)f I mod/ inmnir/(Ci ,poq4 ssvC tkux)TThH   eturning
  cE
exneer
w1 
 TTTT(ng Uhp s  ao)&
uvOiocc )e taPV 0nr Ce
u
 TTT   pp' an   eturninr n  oFoazm=  swRn)lH
:  oim Dg'  moe(tr-esc2 = 1ruv
i = c_AsvvvlIr.fFun w)e tldV 0nr ssCereto41"WCpae)f I mod/ inmnir/(Ci ,poq4 ssvC tkux)TThH   eV.Yex'''T i UtrpPably   ude gtIndex = ConvertKeyToIndex(Ta au)nve de ' t0PPPs:H   eV.vvveea)'''T i Ul(N3  i s cc )e t.veea)'''T i Ul(N3  i s cc )e t.veea)'''T i Ul(N3  i s cc )e t.veea)'''T i UlCr    '  'n 7      rhTK  ( DiChood  00 re Xde f(rv
NCsObject = c_AsvvvlIr.fFun was'etTTTdduEx t:temCeA doooq,EN   (my cyE)OM, t:temCeA Ivvvjit   e de ' a4 Srr.Raise oIrs chun   sKNi FpamiTTd  00 re Xde      o siblingl/////vvsuwfcanin0  sKeerhTK  ( DiChoodttxibIex'tex''yt 00 re Xde f(Rosu(--ja. si  s   r////////vvsuwf(Re)T  ao)&
uv
 thchim D&i Ul(0TvvlIf Ien)az eibIN) N     lPr1 (5)
   hhd Ctor ived apert  'djito41k) nin0/'
 4O.Pt/'
 v En====
 v En====
 v En====
 v En====
 v En====
tooq v En====
EN   (my cyE)OMi///D  sr.Peldexnvsu(tAsvvvvvs\\sd
 x(aTr s /(C dluvvs\sd D.nin0  sKeerhTK  ( DiCvvvlIr.fFun was't     ov
ayaT ly   u=
EN   (vvvlIrESg/3d'T i ggggg
 chimi  imCeA  o,///yde f(rv
NCsObjec (5)
   6sFunC 1mer
    chi-boos S s /(C dluvvs\sd  s,t ni etu00000n thp 
s /(Ci ,cspri   6sFu     nhTTT   ppSe   If .Ya  n En====
 v En====ndex(Tac )e t.veea)'''T i Ul(N3  i s cc )e t.veea)'''T i UlCr    '  'n 7      r ao)&
uv
 thchim D&ig
 chimi  imCeA  o,///yde  o,///yde  o,///yde  o,/ lAsvvvvvsu(t tttttttt imCeeeeeeeeeeevosereldhoooqNiAsvvvvvd iodde S//D  s hhdt:temCeA   RPgnT)n / sParent).    .00erP or n'
T/
 
s /(CPgnTved apertvvlIr.fN3  i s eeiv
 r_Dessvvv- reiH
:  oim Dg'  Dim mo1))Lrt NT)nx'''3IrESg/3d'T i ggggg x e r n'
T/
e r n'
T/
e rCvvvl pn-e0l//yde  o,/ lAsvvvvcDt.   1  a      1k),gl/_AsvvvlIchoooq4  m  e deldhoooqNiAsvvvvvd i///yde  o,///yde  o,///y
 4O.Pt/'
vlIchoooq4 Tminsi00 Noi2Ir.fFunoooq4 Tm0chq( CsObjlveDg&+Asvvvoq4 Tm0(my cyE)OMi/r_DesMpHmCeA  o,to41k)yE)OMi/(5)
 I  o,/ ls reDg&+Asvvvoq4 Tm0(my cyE)OMi/r_DesMpHmCeA  o,to41===nde cc cgrod dooooooooo( D(5)
dddddan'
 y cyE)Oxnvsu(tAsRe)T  ao)&
uooog'lvincei A  i   vs
sen  :d  00 RPgnT)nt
  -- relPro'lveD   pp' an    6a N      ls reD..
vo  rcihhhhD.PPst)AsvCeni etu00000nPro'lv1D  s hh .Tminfxy hh .TminHT.Tminfndex = Cr(Roul..
vo  s    C, retu  Ir:oooooo( D(5)
dddddan'
 y cyE)Oxnvsu(tAsgcr  aidlu  Ir:oooooo( D(5)
dddddan'
   u=
sT=eeee>e 6 xn x e rmy cde ccTndex(Treref'6n tk)lvvvvExitoooq4?/Eef'6n)iUT/(Ci his thhhDertx EExchippppP cE
exn0amiTTf'erPC  frriEc .Tmiazm= codesce  nev
 rsul..
v>A'n thptbInda ovvlIoooov>A'n tr ssCereto41"WCpae)f I mod/ inmniknvy.onoo,to4Tes,tpdIoooov>A likeun gonoo,to4Tes,tpdIoooicc )e t.eeamechNqeEoovIoooicmechNqeEoove,S.Tm'su FpreA
  o c )e tsare'd ut)TT 6 xneerIU aidlu  Ir:ooooooovvlIchooa2rnmniknvy.ona an('
pgr&l'///// 0000nPrCuIr:oooooFpreA
  o ccccccwsric_AsvvvlIr.Pun     ee deldho   V  ee deldho   V  ee  his th a00ma eDr.Ms '
pgr&l   sudncx   l(Funim Dg'  DiationlyTrRen gerd...'y   u wef I ml  gsiv
4 ssvCm(_DIoo&l n If r  latm2vvveea-Pro'lveD   pp' an d...'y vCm(miTTf'e.'y vCban d...)t
4 ssvp' sccr  ooe&-f2:s S  sie    dd D.nin0  sKeerhTK  ( DaTrue
s chunetu000yE)Or.fFu
 TTT   f  dd D.tu  Ir:oooooo( D(5)
dnt).F
   u=
sT=uThentibF   yTrRenlgnT)nt
qr&l'////xneer
w1 
' tarConve de ' t0PPPs   odxkfrnoo,to4Tes,tpdIoooovoneer
w1 iv
1da 0'ao/// 00nve reht grodesce  =
tooq r  latmrDIoo&le 6 xneeaninstibIer lIr.   eeiccccdnt).F
 e t.veea)'''T i UlCbF   y000nPrCuIr:oooooFpreA
  o ccccccwsric_AsvvvlIr.Pun     ee deldho   V  ee deldho   V  ee  his th a00ma eDr.Ms '
pgr&l   sudncx   l(Funim Dg'  DiationlyTrRen gerd...'y   u wef I ml  gsiv
4 ssvCm(_DIoo&l n If r  latm2vvveea-Pro'lveD   pp' an d...'y vCm(miTTf'etibIer lIr. cSriye)p=,Nn Sl(kadj000000ee+ (Roul(Nr, ti=t m_Cn,vvx
ncc. nsuRRRRR   ' if new tree)lFd IfBF  1)), em        Apar,oood   ger
urn) was la next sibling            
                End ux).o.Tmil  1))hi his pppp N     lPr1 hptmy
     c00000000000000000000 x(
   vvrnh=eeee>eNiAsvvv N  n/as la next sibling ebjuveeotwm- .Tmi ml  gsiv
4 ssh  ' t uhspri oo()'  DiatIse mer
oxNCsObjec (5)
Youngervr)siv
t =tminodeo.Tmil  uA i ggggg x e r n'
T/
e r n'
T/
e rCvvvl pn-e0l//ydeTTTTTT,si if
UsvCm>uA i gd   ger
urye)p=,NnAey
 
vo   sKeerhT0oserel1000ax e r n'
T/
e r n'
T/
e rCvvvl pn-e0l//ydeTTTTTT,si if
UsNnAey
 
vo   sK000000ee+ (Roul(Nr, tisbjergspnAey
 
vo   sK000000ee+ (Roul(Nr, if
UsNn m  e deves_AsvvvlIn m  e deves_s/ochoooq4if
Us   0000vvvlIn m  e  (Roul(Nr, ioooq R  e r sae====eeeeee4  (chTvCelAse====ee ' sd    gonoo,t n'
T/
e====ee ' i    paag ue,aaTF Ie ' ssvCeld ux).o.Tmi%   &l n If r  cq R  e /
e rCvvvl pnYS   Fun m  e  (Roul(Nr, iooaaRoul(Nr,ccol(kqoazrI ygEN) N   (ar  cq R  e /
e re===e  o,/svvtex'' sK0000vtexRS   Fun m  deves_sR  e r sae=='T i U re===e  or==ee ' i  
   6Pro'lv/////vvsuw1 
 TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
  odxk i a m_
  o i U re===e  or==ee ' iincei A  iT.Tmil  1))vlDiatieAxi retg in aa  . ,iosud
 x(aT   c
 rmCvvvvsudjito41k) TgtIndfor it rhis pppp Nusu,f mn         ouhspri oo( CsObject =  ss0S'6 gx( ss0S'6 gx( ss0S'6 gx( ss0U re3(kqoazrIreh=eeee>e 6aSmref'6nigtimte2
o  ldxw
hpasD n celAsqoazrIre 
   Oe  Ow aa  .
  -- ay
  sK0000vtexRSsud
 x(aT   ar  cq RrP or n'
v Ifrsyde  o,nAey
 
vo   sK00y
  sK0000vteAsAluhspri oo( sud
 x(aT eee>e 6 xneerIr: eAxiv
4 ssvCm(_DIoo&l n If r  latm2vvveea-Pro'lveD   ppOee)lFd IfBUlCr(r sIr: eAxan'
q   D.: eAxa1.  chim= l(kadju(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvvsu(tAsvvvvdadju(tAsvvoS'lvinc R   in)eecahhhhhhd C Ctorved0n ref',  rpspri oo( CsObject =  ss0S'6 gx(aTrue
sen)a ,cSS'l Irods  sr.Peldexnvsu(tAsvvvvvs\\sd
 x(aTr
  i/e e
sen)a TTT9gsi True
s /(Ci ,cspri oo( CsObject =  ss0S'6 gx(aTrue
sen  ssCe
uhke the folleDei ll s_sp'tree)lFdt =  ss0S'6 gx(aTrue
sen  ssCe
uhke the folleDei ll s_iggggg
ho   V  espnAey
 
vd C Ctorrn;     Ase>ai( CsObject =  ss0S'6 gxmpnAey
D=e  or==Ier    chimi chim= l(kadj(==Ier    chretg in aa  . ,iosud
 like the folleDei ll Oe  Ow oRoul(Nr,ahi FunpppPPsd        E  (chT Moulhe folleDei ll i  .lleDei llonlyTrRen g En====
 gxmpnAey
D=e  iv
 reref'reref're&
uoooe'd 1  iv
 reref'reredan'
 y cinfxyTtc&i Ul(0TvvlIflFdt =  ss0S'6 gxnlyTrRen gerd...'y   u wef I ml  gsiv
4 ssvCm(_DIoo&l n If r  latm2vvveea-Pro'lveD   pp' an d...'y vCm(miTTf'e.'y vCban d...)t
4 ssvp' sccr  ooe&-f2:s S  sie    dd D.nin0  sKeerhTK  ( DaTrue
s chunetu000yE)Or.fFu
 TTT   f  dd D.tu  Ir:oooooo( D(5)
dnt).F
  tr:ooooovoo( D(5000000000000fFu
i ,cspri (kadju(tAsvn)a TTT9gsi xan'aFaunpppPPrue .Tmea-Prvn)a TTT9gs0S'-ohridlu  Ir:TT9gs0Bju(tAsvn)a TTEbsvn)a spnAey
 tcccwsrt)a TTEbsvn)a spnAey
 :oooFu
i ,cspri (kavvlIoo&&&&&&&&  cpPPrue e'."nocce)pnAsvvvr00l(N3AC))a TTEbsvns4
i ,cspri (kc cgrod)a TTT(kavvyerer0.'iW)l000000000himi sDei e'pxri c_Araiseic_Asvvvh  ge y0ma eDr. TTu oo()' 99pr = 0sTTTTTi' :Sw  TTTTi' :Sw  Tv 0sTTTTT>la TTT(kavvyerer0.'iW)l000000000h,csprawas la T>la TTT(kavvyerer0.'iW)l0000Rw(coS gx(aTrueid IfBF schi FuBr:oooooo("mA dooo s hrrereo()' 99pr =  I)S. rei vvvd iof'e s   r///T(ka'  cspri ri ll OytAsvn)a N  f r///T(ka'  cspri ri ll OytAsvn)a N  f r///T(ka'  cspri ri ll Oyt,nAsvv,poq4 ssvC'  sr.Pl Oyt,vncx /pri ri :ooooo(kc cgreo)ph=eTTi  iv
  xt_Dl OypPPsd -svns4
i ,cspri (kc cgrod Uhp s  ao)&
uvOiocc )''T i ynccwsrtret/,00000h,csprawas vvl pa'  c giW  ri.Raise Er=occe)pnAsvvvsK0luvvsitoq4  (chippppPer    2amiTTf taf IiiC0 ao)ro("mA dooo eDei ll i lIr.PelP MI TgtIndIni FpreA
  ootThen gkvo   sn gkvo   sn TTTTTTTTTTiee(G00hT.Pt/'
 vs_Asvvvm''T i ynccwse'd ut)TT   i chim Dg'  moe(eA
=='T i:reA
yerelEp' sccr  ooe&-f0  sKpitd u
rnatiol  9esvvr =  tor iti :ooooo(kce'd utCP rt/   i2in Caidincgrodd)AA ioul(Fueot,:nesiv
hpasDo-f0  l  9ece)pnAsvvtrttwm- .Tmir: eAxiv
4 sI
 If
 i   ee+din o)e = r = 0sTTTTTi'lIr.PelP MoulWW). 00000000000000000If
r:oooooo( D(5aooooo( D(5oul(NrrlsTTTTTIf
 i  o( vvvl pnYS   Fune ' t0PPPs:H   eV.I
 v En=ii ,cspriIl0000Rw(coS gx(aTruvoS' = C  i chim DelNey
  sK0000vteAsAluhspri oo( sud
 x(aT ee  aov
hpeee+ (ReFEoove,S.Tm'su chiee 0er = 0 vvvvvvm.sCdeTTTTTT,si if Conv
==e   ee+din o)e = r =i)&
uvOiouc  moe(eA
=='T yerer0.'iW)l000000000himiv
hpasD  sK0000vteAsAluhspl  gsutoIrs chuTaooooo( D(din o)eiof'e( vvvl pnYS   Fune ' t0PPPs:H   eV.I
 v En=ii ,cspriIl0000Rw(coS _Lretg iia''T i ynccwsTTT,si rp:Slot:temCeazrIre 
  ,S.Tm'seo 
Pu000 gsutoIrs chuTaooooo( D(din o)eio   chi-boos ScyTexurnhdu)r nTrd T y  Ir: f'r,   i U rPPeldxtDI).on0n)r nTrUEn=ii dv  u=
EN ' ssvCetmCeeu)r nTrd Tr.PelP MI TgtIndIniw N  ft sSTmCpan'
   i   ecahqeisniPn
sT=s t0PPPs:H d.. 4   = I  ,S.ThevvvPrvn)a TTT9gsdv  u=
Eecahqeiv
hpasDom.sCdeTTTTTTD(din)tsptl2000ee+ pi moe(ex'''Thevvvvv  'tIndIniw N  ft sSTmCpan'
   iv  u=
Eecahqeiv
hpasDom.tTTD(din)tsp hisoTgtInnhuTaooon)tsp hi  Ir: f U rPPeldxtDI).on0n)r nTrUEn= hisoTen  ssCe
uhke the foycwsTTT,si rpdxkfrnoo,to4TeDelNspasD ul(Nitd u I'aFtec,oaof'e( vv
Pu00tsp hisoTgTul(Niooopto4TeDooe&-f2itd u
rnatiol  9O i2 =  ss0S'6rMdIni chiee+ pi .I
 v En=ii ,cspriIl0000Rw(coS gx(aTruvoS' = C  i chim DelNey
  sK0000vteAsAluh_AsvvvlInssCeI).vteAsAluhs' an   eturninr
rnat xEecahqeiv
hpasDom'6 gx( ss0S'6 gx( ss0U                End ux).o.V.vvveea)''iknvy.ona aFtPeldxtDI).Uy(5)
hpasDo-fi ynccwsTTT,wrs ''iknvy.ona aFuisniPn=
EN   (my kS gx(aTruv
  o c )e tgrodd)Ai(aTruvrI ygEN) N   (arsTTT,wvteAFpreA
  oc0000vteAsAluh_AsvvvlInsTo ctgl(T(5)pdxO)vvvl pnYS   Fune ' t0Pei ll s(aTru,sUhp s  ao eeiccccdnt).F
 e t.veea)'''T i UllInsTo ctgl(T(5)pdxO)vvvl pnYS   Fune ' t0Pei ll s(aTru,sUhp s  ao eeiccccdnt).e+din owrs ''ikcx   l(Funim Dg'  i dv  u=
ENx( ctgl(T(5)pdt grodesssssssssssssss si    e crodeniPn
sT=s t0essssssssYS   InsT(T(5)pdxO)vvvl pnYS   FuneMit ref  irefrgsi retgiW). Then;w( '         ov
ayaT     eThq4Ie),eld isgTul/pnYSe ScyTexu N  ft  ooe&-2 I mod/s x efault 2vvveea-Prn;w( '     ot,:nes)cspri oo( CsTe00o  tf IR99s S t0PeiO)vvvl pAoo( d    g]s' an  g]s' anIniTTTTTTTTp1mowrsS,,,,,,,,,,,,,,,bt).F
 e t.veea)'deTTTom  un    





T(T(5)pdw( 'w( e crodeade tgrodd00000,oaof'e( vv
Pu00tsp hisoTgTul(n(miTTf'e.'y nTrd Tr.Pn  g]s' anInidiTTTTTTTTp1 eDr. 
    nins      ov
dxtDI).UF,,,,ppP cEenCona aFuisniPn=
EN  f),ppP cEenCona aF)s)csprimgiW  ri.Raise Er=occe)pnAsvvvsK0luvvsitoq4  (chippppPer    2amiTTf taf IiiC0 ao)ro("mA dooo eDei ll i lIr.PelP MI TgtIndIni FpreA
  ootThen gkvo   sn gkvo   sn TTTTTTTTTTie t0Pei ll s(aTru,sUhp s  ahimdInaF)s'E ootTheneona  MIe)f I mod/ inmniknvy.onoo,to4Tes,tpdIoooov>A likeun gonoo,to4Tes,ippppP cS I mod/ ioaof'e( mdInaF)s'E ootThioa'         Wp   Index).KpasDo-f0  l  9ece)pnAsvvtFpreAIniTI1("mA ( mdo,to4Tesvcx   IniTI1("mA (   Index)ar isgTul/pnYSe ScyTexu N  ft   ot,:nes)cf(Re)T  ao)To0000h,csprnesiv
hpasr: d
 4O eibIer lIr cS I mod/ ioao  ft   eni oo,to4Tes      '
  (aTrux).Koo(t,:nesiv2hp 
s /h opaag ue,aaTF Ie ' ssvf'rrat gsiv
a0000Rw(coS g      Ces x efaurgsi re ''ikT0 ao)asDo-f



 SVo-f

i      roO ef
 ilIr cS I0000Rw(.Tm
 x(aT ee  aov
hpeee+ (ReFEoove,S.Tm'su chiee 0er = 0 vvvvvvm.sCdeTTTTTT,si if Conv
==e   ee+dRo,K,Nnd Ifree)pIUnC0000002oeuao)&
uvO     roO ef
 ilIr cS p)pkHdr//////////////////////////////////////////////////////p-L m_ x).      End I    m_Col  )Hi00 refr refrg]s' g]s' g]s' g]ooall s(aTru,sUhp sctgl(T(5nesiv
]s'aAoO ef
 ilI/tgl(T(5K,NnC0me=='T i U re===e  or==ee ' i  
   6Pro'lv/////vvsuw1 
 TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
  odxk i a m_
  .PPst) i my c
  odxk.o.Tmvsudjito41k)Diationl///vvsuw1 
 Tmi(   Ind)pnAsvvtFpreAInlIr cT(T(5
  (0000R) i ms_sF)s'E ootThioa'     o41k)DH d.. 4 ereA
yee  Ind)N'Xvvvvv x).      End I    m_Col  )Hi00 refr refrg]s' g]s' g]s' g]ooall s(aTru,sUhp sctgl(T(5nesiv
]s'aAoO ef
 ilI/tgl(T(5K,NnC0me=='T i U re===e  or==ee ' i  
   6Pro'lv/////vvsuw1 
 TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
  odxk i a m_
  .PPst) i my c
  odxk.o e r n, ors,tpi ootT'rrat  D       ean d...'y vCm(miTTf'et' if new tree)lFd IfBF  ito41k)Diationl///vvsuw1 
 Tmi(   Ind)pnAsvvtFpreAInlIr cT(T(5
  (0000R) i ms_sF)s'E ootThioa'     o41k)DH d.. 4 er&p:Slo   i2inInd)pnAsvvtFpra,AInlIr cT(T(5W)99s S t0Pesvso ler  ooe&-2    0l(/vvsuwvhr  D      etg iia''T i y0&ene(Fu      eeeeeeeeeeem_
  .PPr1 hptm)a spnAey
 :o(Ceeu)r nTrd Tr.PelP MI TgtIndIniw N  mmmmmmmmm'E ootThioa'  vlDiapnAey
mP cS I mod/ ioaof'eing m-ei,nchcgoo p
 TmifrgmnAsvcgoo pt0 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrim= Nbject r     aze.'iWi Uhp\e3vPeld  hl(FunneeeeevvtFpreAIgeAsAluhs= Nbject r     aze/'
 vON '(kadju(tAs
 :o(CF.     e'T i y0&ene($0er = 0 vvvvvvm.sCdeTTTTTT,sii y0&ene($0erlnYSe ScyTes' g v Eluvvsitoq4  (chipps F  ito41k)Diati
mP Uhp\e3vPeld  hl(Fun( spnAey
 :o(Ceeu)r nTrd Tr.Pe-niknvti(5
elTT9gstm)a spnAey
 :ouiiC-yovoS' =,,,,,r s=eei(Raise Er=occe)pnAsvvvsK0luvvm.     e'T i y0&ene($0er = 0 vvvvvvm.sCdeTTTTTT,sii y
 :o(Ceawas la T>er    ((((((((( la T>' imav  u=
EecavvsayS.Fun( spnAey
 :o(Ceeu)r nTTTT   f  dd ((((  ootTc R   E?hKy objuveAxan'x) nooul(NocgtInd   Ie),eld isgT' imav  u   0nlIr reht gsiv
 rrue
   E?is F  ito41kaise Er=occe00vteAsAa spnAey
  od ut) :ouiiC-yo)
RennYSe Sw  TTTTi'E spnenAey
  od ut) :ouiiC-yo)
RennYS s\sd D.nin0nimnvti('reniw N 3     azelll Oyt,nAsvv,poq4tttt in( ss0U                End ux).o.YSekadju(tAr.Pri r  eV.I
 v En=ii ,cspriIl0000Rw(coS _Lretg iia''T i ynccwsTTT,si rp:Sx) n eV.pasD gmnAsvcVd ler  oo   o4( d oS _Lretg iia''T i ynccwsTTT,si rp     n eV.pT i ggggg
 chimi  imCeA  o,/gsiv
f9     euvvs'Peld  as la T>er    ((((((((( la T>' imvti('re)choooq4  m  e .nin0nimnvti('reniw N 3     azelll Oyt,nAmnvtawas la TpkHdr///rgsi x efaurgsi Oyt,nAmnvta  o   azelll Oyt,niw N 3     azeii d4?/Eef'6n)iUTerIr: eAxadtx'teTT,si rawas la TpkH)as la TpkHdr///rgsi x efaurgsi Otgl(T(5)pdxO)vvvl-tnccwr\sd DiThioa'  vlDiapnAey
ctx'teTT,si rawas l DiThioa'  vlDiapnAey
ctx'teTT,si rawas l DiThioa'  vlDiapnAt(apPst) i my c st) i myt-i Otgl(ctx'teTT,si rawaE ootThioaw N 3      2amin/vlDnTrd T y  Ir,tTTTdd/-relEp' sccr  ooe&;,/g6n)ivvvvvvvvAa m_
  .PPsufkHdr///rgitxdde f'regsiv
af'r i ms_sF)s'E PPsd    /g6n)ivvvvvvvvAaTTaeswaE /rgitxdde f'rr .PPsufkHdr///rgiNswaE /rE /ras relcTTTdd/-re)pnAsvvvsK0ieAxi retvvvvAa m_
  .PPsufkHd vvh    Un;w( 'Aul(Nr, ioooq   .PPsufkHd vvct r iv
a000 vvvvvvm.sCdeT6n)ivvvvgNbject r  to  frgsi r,,s\sd D.nin0nimnvti('aFh/rgitxdder    2<. 0lph=eeee   .PPsufkHd v&-f2itd  hl(Fun)sufkHd gtInd   Ie),eld isnvti('aFh/rgf ob  aooooo( D(5oua=
Fn'x) nooulvvlDuveAxan' :Sm)a spnAey
 :o(Ceeu)r nTrd Tr.PelP MI TgtIndIniw N rtr.PelP dIniw?t    ,l(Nitd u I'aFtec,oaof'e( vv
Pu00tsp hiM odxk i a m_
  .aniw N r hiM odxk ieney .aniw NveAxan'ma4Psufk   oove,S.Tm'sugoa'   ol Oyt,nAmnvtawdtx'teTT,si rawa/ch0:dddddddddd
  .PPodxk e==T,si rawm//////////////vvvvvvAaefaurgsi Otgl(T>pdt grodessss Dwuae,S.Tm'so00h,cspre&-f2IacTTTdd/-reject r  to  fr 3 '
 s\sd iV8///////////




cT-ly elph=eeee  ra,AInlIr cT(T(5W)99s S gTrd Tr.PelP MI TgtivvvvgNbject r essIe),eld isnv////////////iationl///dn' :Sm)a spna5oua gTrd Tr.PelP M (T(5
  Ttiv
1da 00000 'tIyt-i Otgl(ctx'teTT,si rcgrodd)VhevvvPrv
 thchim//////grodd)VhevvvPrv
 thchim////(e aFuisniPn=aise Em/ionl///vvsuw1 
 Tmi(   Ind)pi)t xEenob  Ie1hchidd/-rej(aTrue
sen  ssCa)'''T i UlCbF   y000nPse Em/ione ' t(5oua= rawm//////////////vv a      1k),gl/_AsvvsprAevvtFpreArav
1dob   gd   geeee
sen  ssCa)'''T i UlCbF   y000nPs vvh   ////////ione ' t(ly elphS, reD TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTiee(.Parenxctgl(TgCeriould use souefrgsi row(cSurnn  oul(Fun  oul  TvvlIr.PelP Moul(Fun  oelP Mref'vv
 chimi    yn  sric_AsvvvlIr.PelP MI TgtIndIni FpreA
  ootThen giW). .0      groO ecah&l'ts choooq4?,pthavsslhen tl(e h ni FpreA
pD(5)
dntE ootaiee(G00hT.PtasTTTTTTTTaAoOi FpreA
  iimi    yn  srDuhen giW). .0 im= NbjecteA
pD(5)Rw(scahqeisnAxaaaaaa) FpreA
pD(5)
dntpdIoooov>A likeun gonoo,to4Tes,ippph  iitdan'
 y cinTTT,si if C)ii y
 :o(v
hpeee+ (Releee+ (Rel
imi  SrgTgtIvTr.PelP'
 y ceeevvtFpreAI  azeba/Eef'6n)iUTlP  o(v
h' moxO)I  azeba/Eef'6tring nn  oul(FEm/ione ' t SrgTgtaTTTTTTTTTTTTTTTCbF   y000nPse Em/ione ' t(5oua= rawm//////////////vv a      1k),gl/_Asvvctx'teTT
hpeee+ leee+ (Rel
imi  SrgTgoall e ' i  mHIe)tHS' = a 1k),gl/_Asvvoua= rawm/_Asvvct_Coxdde(RelTeArav
1dob///vv a   choooq4?rh ni Fpr' i  mHIe)tHSssCa)tpdIoooov>A y1k),gl/_Asvvctx'teTTun gonippph  iitdan'
 y c(T(5
  (0iitdan'
 y c(T(5choooq4?rh ni Fpr' oyt,no)////l/_Asvvctx'teTTu oFoazrI yg00crvctuul(Fun      hioa'  occ )in(F.T00yE)Or.fFu4T00y/////no)////l/e





T(T(5)x'teTTu oFsvvctx'tree)lFd(coS _Lretgty
 aag ue,aaTF Ie ' ssvCeld ux).o.Tmi%   &l n If r  ygENasd Tgt .0  ss0U         eag ue,aaTF Ie ' ssvSrmnAsvcVd lerr  yg(v
h' m///vv     his pppp Nusv>AnCa)tpdIoooov>A y1k),gl/_Asvvctpa)tpdIoooov>A y1kouiiC-yyyyyy' ,csSrgTgtIv Ie ' ssvSrmnAsvcVd Coq4?rh ni Fpr' oyt,no)////l/_Asvvctx'teTTu oFoazrI yg0dob///vv a   choooq4,-: woud
 rmCvvvvsu(tiseCeazrIrepdxO)vvvlerr  yg(v
h'   frgsi nro, Pu(mya  riSrgTrt&l,gl/_Asvvc'C   choooqn(F.Tee(G00hT.Pt/'
 vs_v
h'o4Ti ni Fpr' oyt,no    ev>AnCa)tl(FagTrd Trione ' t(5oua= ri retvvvvAa_v
h'o4-: woud
 rmCvvm/_Asvvcto)tpilI/tgl(T(5re)pnAsereAIniTI1("mA ( mdo,t.l DsvSrmK0000vteAsAluhspr  geeee
sen  to)t N 3     ,,Aa_v
h'o4-:sa)tpiAey
ctxr ni aex).Kpao p s  aomHIe)txO)vvvl-tnccwgmO i2 = CC ev>AnuPPsd    /g6n)ivo  iitdan'
rsie    bDwuaei frgsi nro, Pu(mya  riSrgTrt&l,x(aTteTTu ex).Kpao p s  aomH5Ga:0000 n  ouIoooovlcwgmO idIons      do,t.l DsvSrmK0000tx'teThioa'  vl nro, Pu(myan  ouIooooooons sctgm.  TgtIndfor e
sen  tgmO i2 = CC tq4,-: wosvvvlIn 'e( vv
Pu00tsp hisoTgTul(Niooopto4TeDooe&-f2itd ux).Kpao p ss chuTarCgTrt&l,x(aT:ooooo(kce'oem/_AsvvPPsufkIoooov>Ai his pppppppp Nusu,f mn         ouhspri oo(aomH5vctx'ttsi rawas l DiThioa'  vlDiaav4TeDooe&-f2itd ux).Kp("mA ( mdoC-yovoS' =,,,,,r s=eei(Raise EnCa)tl(Fag00hTrtd ux) mdo,to4erlm)asen)TeDooe&-f2itd ux).Ky' ,csSrgTgk;ux).Ky' ,csaiapnAey
ctx'tpue,aaTF Ie ' ssvCeld ux).o.Tmi%   wo'lv/////vvlooe8   ione ux) sTTdd/-relK0000vteAsAluhspag00hTr-Ecc'
rsie   NeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaH5Ga:00svvvsK0ieAxiTF Ie ' ssu(tiseC0 vvvvvtgl(T(5eee+ (Rel
ih' m//rmCvvmObjectsiee&-f2io,to4 :ouiiAxiTF Ie ' ssu(tiseCo41k) nro4-:sa)tpiro4-:sa)tpiro4w(aTtIe ' cTTTdd/-re)mW  ri.Raise  ni Fptl)T-ly  Tultpdxk i )TT   i  aI  Co)csprelNexr =====' cTn)sd    /g6n)ivo  iie&-f2itd ux).Ky' ,csSrgTgk;ux).Ky' ,csAluhspr
 TmiTTgx( sd=' cTnTzeba/00ta"oulouIooooTTTdd/-re)mW  ri.RoPu(myan ;Ox) mdo,to)f2itd  hl(Fun)sufkHd gtInd   Ie),eld isnvti('aFh/rgf ob  aooooo( D(5oua=re)mW  ri;ux).Ky' ,csAluhspr
 TmiTTgx( sd=' cTnTzeba/00ta"oulouIooooTTTdd/-re)mW  ri.RoPu(myan ;Ox) mdo,to)f2itd  hl(Fun)sufkHd gtInd   Ie),eld isnvti('aFh/rgf ob  aooooo( D(5oua=re)mW  ri;ux).Ky' ,csAluhspr
 TmiTTgx( sd=' cTnTzeba/00ta"oulouIooooTTTdd/-re)mW  ri.RoPW)l000000000himiv
hpaw( mdosr(tisTTgx( sd=' cTnTzeba/00...'y   u wef I ml (lveDg'a = Nexr =====Eoove,S.Tm'su ch.:temCeazrIre 
  ,S.Tm'seo 
Pu000 gsutoIrs chuTaooooo( D(din o)eio   chi-boos ScyTo ctglmCeazrI1vvctx'teTTuP Mvvvl pnYS  tnccwr\sd DiTh)f2it mdosr(tisTTgsotglmCeastglmx'teTTuP M l DAhL    
e Amnvta_(Funchim/////eo.Tmi ctgl(T((evAa_v
h'o///eo.td ux) mdo,trIe ' ssu(tiseCeTTTTTn ;Ox) Sn000himi(   wo gtInd  r Ifuh_AsvvvlIhpaskr:o/(Ci ,cspri   6sFu   ns sctgpnAsvvvsK0lup'e  wo gtInd  r IfuhM====Eooveehpaskr:o/(Ci ,cspri   6sFVTCi ,csprvlIr.fN3tHS' = a Sn0otglmCeasiTTgx( sd=' ctglmx'teTe+ (Roul(N3  i s  inmnir/r.fNooe8   ioneoooov>A y1k)5oua=reo,to)fo/(CiHS' = a SnTNTTT   l)TT   i my  s  cccdnt).F
 e t.veea)'tIndIniw N  mmmmmmmmm'E   aooooo( D(5 g]s' g]ooam)tpilI/tgl(T(awctglmCettt in( ss0U  -f2io,to4 :ouiiAxiTF nd  r Aa_v
h'iAIniTI1(i  mHIe)tHSs(T(5choooq4?rh ni Fpr' oyt,no)////l/_Asvvctx'teTTu oFoazrI yg00crvctuul(Fun      hioa'  occ oooonsevvr' o-re)mW  ri.2yuD(5)
dntpppa oFoazrI yg00crvctuul(FunEcrvctuul(FunEcrvctuul(FunEcrvctuul(FunEcrvoT,si rawase1uul(FunEcrvctuul(Fu;ux)oooooooctglmCeazrI1u y1kfN3tHS' =CdeTT0 refya(tiseiitdan'
lrvctu y0&ene($luhspr(aTr s /   6sFu   ns sctgpnAsvvvsK0lup'e  wo gtInd  r IfuhM====Eooveehpaskr:oore)m'a =r s=fuhM=sotglmCeastgstiseCeTTTTTno.: eAxa1.  chim= l(kadju(tAsvvvvvsu(t = 1/'rto s= . ni Fpr' i  mHI.:temCeCri ri :ooooo(kcn.  chim= l(kadju(tAsvvvvvInd  r IfuhMt = 1/'Tgx(6sFIfuhMt =_Aski )TT   i  aI4?rh  ctglvAa_v
h'ene($0er =  t = 1/'Tgx(6sFl(kact/ = 1/'TtxibIex'tex''yt tglsvvrunpppPPsd     oo(kpppPPsd  /'Tgx(6sFIfuhMt ppp NusudresinasD n vvrunppvvvvvInd  r dd/-relK0oua= ri (5chmi(   we&;,/g6n)ivvvvvvvvAa m_
Nus'deTe ful(N3  i s  inmnir/IniwrH/ = 1AAAAAAAppppp Nusu,f mn         ouhspri oo(aomH5vcee EtgpnAsvt(kcTTTTp1monuulInd)pi)Tm'erkIndUxe  ctglvAa_v
lvAa_v
h'ene($0er =  t = 1/'Tgx(6sFl(kact/t = 1/'Tg  Aa_v
h'(Rel
C-yo)
RennY i s  inmnir/Iniwrl
imi  iThioa'  vlDvvr wo gtIC -?un)sufkct/t = 1/'Tg  Aae 't/t             riSrgTr'deTect/t = 1/'Tg  Aa_v
h'(Rel
C-yo)
Rpun)ing eb(aTru,sUaaaaa:og ebv
h'enul(N3  i s  e  ctglvAasr(tisT ylo ctgl(TgUs)
dntE ootaien       u y0en       utx'teTsr(tisT ylo ctglr(aTr s /   Ot tgrodd)Ai  1/'Tg a_v
h'dd)Ai  1/'Tg a_v
h'dd)Ai  1/'Tg a_v
h'dd)Ai  1/'Tg au(oa= d)Ai  1/'Tg En====
 v En====ndex(Taeu00tsp hisotIC -?Vsd   tv En====nd,r s=evAa_v
h'ene($0er =  t = 1/00vteA6cx = vvvIndCOnvctunppvvvvvInd  raFh/rgf ob  aooooo( D(5oua=re)mW  ri;ux).Ky' ,csAluhspr
 TmiTTgx( sd=' cTnTzeba/00ta"oulouIooooTTTdd/-re)mW  ri.RoPu(myan ;Oxtce'oem/_AsvvPPW3esene($luhspr(vvvvE'dd)Ai  1/'Tg a_v
h'dd)Ai  1/'Tg a_v
h'dd)Ai  1/'Tg au(oa= d)Ai  1/'Tg En====
 v En====ndex(Taeu00tsp hisotIC -?Vsd   tv En====nd,r s=evAa_v
h'ene($0er =  ti4-:saaaa En========ationl///vvW3esene =_Pefrim= Nbject r     aze.'iWi Uhp\e3vPeld  hl(FunneeeeevvvIndCOnvctunppv,gl/ppv,gl/pppi)t xEenob  Ie1hchiddI==nd,r ssu
     Axan'x) nel'ts choooq4 r    .' hi  o ppvvvvvInd  raFh/rgf ob  aooooo( D(5oua=relE choooq4 r  nl&-f2itdneer
w1 .' hi  o ppvvvvvInd  raFh/rgf oNCsObjecKy' ,csAluhspr
 TmiTTgx gsutoIH$)mW  n).Kp("isniPn=aise Em/ionl/'dd)Ai  1rgTrn gonoo,to4Tes,i :ooooo(kcn.  c TmiuG8 x( e ful onl/isT ylo
     Axan'x) ne8i     Axan'x) nel'tsta"oulo''F  ito41el'ts e.'iWitpiro4w(1rgTrn gononctuntpiroEe Sw  TTTTi'E sp. 4 esT ylo ctglr(a2eDooe&-f2itd ux t = 1" ooogTrn gonoo,to4Tes,i )cksrgTgk;ux).Ky' ,csAluhupW3esene =_Pefrim= Nbje          '
  (uze>e 6 oua=relE choooq4 r  nlurf ob  0iooooo-re)mWC -?Vsd   tvAi  1rgTrn gonoo,to4 sd=' ctgi :ooo,to4Teito41k)pertvvlIr.(kcn.  a vInd  raFh/rgf ob  aooooo( D(5oudxtDI).UF,,,,ppPf  odxkfrnoo,to4TevlIr.(kcveea)' oStrg,ppPf  odxkfrnd ux).,,ppPfta"oull,ppPfta"oull,pp000"oull,ppPfta"oull,pp000"oull,t//yde  o,/pvvvevlIr.(kumvs_Asvvvm''T i yjecKy' ,csAluhspr
 Tm"ationlyaFh/rrsvvvsu(tAsvvvvvs\sd
s_AsvIr.(ow(cSurnn  opoae====ehiuhsprvOiouc  a=relE choooq4 r  nlurfni Fpr' oyt, vurnnioa'  vlteTTu ex).Kpao p s  aompreAIgeAsAluhs= Nbject r  ien  (ow(cSuex).Kpao p s  aoma,pp000"oull,ppPu ex).Kpao p s   ' t
h'dd)Ai  1/'Tg au(oa= d)Ai  1/'Tg En====
 v En====ndex(TSnAxaaaaaa) FpreA    eThq4Ie),eldsvIr.(ow(cSFh/rrsvvvsu(eevvvInu ex).h'dd)Ai retvvvvAa m_
"aaa(TSn,vInu eIndvooo
 v En====
tooq''ikT0 ao)alWW). 0000000ueo,t   ==nd,r  t
h'dd)Ai)vInd  ^r  1/'Tg En====
 v En====ndeikT0 au00tEn==
 Tm"ationlyene($0er =  t = p000"ou t Fh/rgf ob &d En====ndeeTTuP Mr+r
i)'e  wo /dAInasD n gx(1.  chim= l(kadju(tAsvvvvvsu(t = 1/'rto s= . ni Fpr' i  mHI.:temlTTuP Mvvvl uP Mr+r
i)'e  wo /dAInasD n gx(1.ee+ (ssufkct/t =cKy' ,csAluhspr
 Tm"ationlyaFh/rrsvvvsu(tAsvvvvvs\sd
s_AsvIr.(oCies,ippph  iitd:= . ni Fpr' i  mHI.:temlTTuP Mvvvl uP Mr+r
i)'e gx( sd=' ccveea)' o onl/Mvvvl uP Mr+r
i)'e gx( sd=' ccveea+ r    x nel'  un     e rooq4y  un     e ro
 an  op    imCeeeeeeeeeeevo  ooring nn ras laD  sr.PHI.:temlsu(t = 1/'rto bt;iro4w(1rg,s  sr.Peldexnvsu(tAsvvvvvs\\\\\\\\\\ vurnnioa' )xypPPsd -sI m_
"iuTarCoe r n'
T/
e rCvvvl pn-e0l/ s=evAa_vvvs\sd
s_AsvrCos ooring nn ras laD  ).Kpao p s Eu0000000ueoaD  )n'
T/vvvs\\00000000hlCbF   y000nPseC<d Tr.PelCa)tvvl uiTTgx gsutoIH$)mW  n).Kp("isn.ioo(kcn.s00y//En====ndeeTTuoooo( /_AsvvPPW3esene($luhspr(vvvvi1uiTTgxrti :o"ou t Fh/rgf ob &d Enx'teTT,sirgTrn gonoo,to4 vs\\\\\\\\ooooooons00hTrtd ux) mdo,to4erlm)as gonoo,too/////lteTTu eC = CC = CC = CCTrtd ux))ueoi r,,s\sdpoons0rene($0er ==========================
i)'e'T i Ul(sn.io'e'T i Ul(sb &d Enx'teTT,sirgTrn gonoo,tob///v. .0 imtob///v. .0 imtob///oT>' v
  xt_Dl OlP  o(v
h' mox CCteTT,sC = C.Aey
 :o(CeeuEg En====
 y ,c= CCTrtd ux))ueoi ri(Niooopto4TeDoontpppa )T uTT,sirgTrn gonoo,tob//ve ful onl/io  oo/r ux))unx't En====n).Kp("isn.ior =====' cTn)sd    /g6 ux))ueoi r,,s6Lo/_AsvvPPW3esDoontpppa )T uTT,ppaF Ie miTTf'e.'y vCbsiTTgx( opiro4-:sa)tpiroooooooooo'pou t Fh/rgfd,r  t
h'dn  tv En===n0  sKeerhTK  ( DaTrue( opiro4-:sr4l(keA
  odxk i a m_
  .PPst) i my c
  o1f ylo ch/rgfd,r  t
h'dnpS opiro4-:sc
  o1f nl/iE
     Axan'x) nmox CCsc
  o1freoi ri(N     Axan'xopiro4-:sc
  o1f nl/iEo&;hene($luhspa) FpreA    //oT>' v
  xt_Dl OlP  o(v
h' mox CCteTT,sC = C.Aey
 :o(CeeuE TmiTiamC = CC  UnC = CC  UeA    //oT>' v
  xt0 imtob///oTa=====================
i)1S   Fun m  e  (Roul(Nr, iooaaRoul(Nr,ccol(kqoazrI 2itd uxitt0 imtob///oTa==y:tl/iEo&;hene($luhFVTCi ,cfreoiS r    .'ea)' o onl/Mvvvl uP Mfta"oTTTTpTTTo/_Asr"t i chim csIix 'aFtec,oveLn thhPPstOOOovnhpas uP MfP Mrlt ss0S9s +nnnnnnlaD  sr.PHIIndCOnvctu  1k),gl/_(myani/e e
sen(TSn,vInu  neloT>' visT ylo ctgl(Tgd/-m  e  (\\ vurnnioa' )xy //oT>nel'ts choooq4 r    .' hi (myan ;Ox) mdo,to)f2it)xy //oTa========a==y:t onL i x)     .' hi (_oooov>A y1k),gl-f2itdneer
w1 .' hi  /Mvvvl uP: En===n0  sK_Asrw2itd ux).Ky' ,csSrgTgk;ux).Ky' ,csaiapnAey
ctx'tpue,aaTF Ie ' ssvCeld ux).o.Tmi%   wo'lv/////vvngT(5)laD  sr.PHIIndCOnvctu o.TEtTTTTpTTTTTTTTTTTTTT' ssi x)  mdo,t)e8i     Axan),eldsvIr.(owtob///oTa==/Mvvvl r.PelP'
 y ct0 imtP' hi (_oooov;neloT>' visCa)tpdI(//grodd)tsssi .Aey
 :y' ,csaiapnAey
ctx'tpue,aaTF Ie.(kcveeu(aTtIe ' cTTTdd/-re)mW  ri.Raise  ni Fptl)T-ly  Tultpdxk i )TT   i  aI  Co)csprelNexr ====IniTI1(i  mHIe)tHSs//v. .0 imt / sParent).FamiiseCeTTTTTn  6Prf=====================,===n0  sKeeol(kqoazrI 2itd uxitt0 rrrrrrrrrrrrrrrrrrrrrtionlyaFh/r========vvs\sd imCeA  o,///yde f(rv
NCsObjec (5)
   6sFunC 1merrrrrrrrrrrrrrrrrrrrrtionlya hi ueoi 'rrrrru t =pS opiro4-:sc
  o1f nlwtob///am  o1freoi ri(N 000hi ueo1f nlwtob//rrrrtionlyaFh/r========vvs\sd imCeA  o,///yde f(rv
NCsObjec (5)
   6sFunC 1merrrrrrrrrrrrrrrrrrrrrtionlya hi ueoi 'rrrrru t =pS opiro4-:sc
  o1f nlwtob///am  o1freoi ri(N 000hi ueo1f nlwtob//rrrrtionlyaFh/r========vvs\sd imCeA  o,///ydwaoma,pp00ea-Prvn)a Tvvvs\sd====v(i  mH
   6lCbF wtob//rrrrtsnC 1merrrrrrrrrrrr-Ky' ,ck/ s=evAa_vvvs\sd
s_AsvrCos ooring nn ras laD  ).Kperrrrr//////ib 2itd uxitt0 a'ri.2y ls reeb2a/'Tg En====n(TSnr ).Kr ====IniTI1ey
D=etemCeavvvvvvvvAa m_
N imt CC 
i)'
^r  1/'Tg En====
 v Ecriioooq4?lr Raouoeto refeyefault oa an('
prs choooq4  m  e eoi 'rrrrru./m= l(ko CC 
i)'
y ls reeb2a/'Tg    i  aI  Co)awo'lv//('
prs crrrrru./mot0 a'ri.2y ls reeb2a/') au(vsayS.Fuo.: eAxa1.   2itd uxitt0eevvtFpreAIgeAsArldsa)tplTTTTT' ssi x)En====
 =IniTI1i&en Exitsvdw( hioa'   :)&s//v. aoma,p
 =IniTI1i&eimo( /_Asvw( hioa'rs cnt
h'dd) 000hi ueoilouIl kTTT' ssi x)E5Ow oRoul(N8=============
i)1S   Fun m  e  (Roul(nIr:    sdddd0hi ueoilouIl k d) 000ha mE5Ow oRoul(N8=============
1uiTTgxrti :o"our:    sdddd0hi ueoilouIl (FEm/8=============
i)1S   Fun m  e  r\sd DiThidm  e  r\sd DiThidm  e  r\sd dm  e True
s /(Ci ,csen)TeDooe&apnAey
? r\ eoi 'rvdw( hi\sd T>' v
  xt_iin0  s,ooe&apnAey
? r.  chim//lteTTua6 ux))ueoi r,,s6eisnAx===
1uiTsen'dd)Ai 1/'T6sFl(kactTTTTTTf
s_AsvrCrVeh   hhd Cot,:nes)cf(R=pS I1i&en Exitsvo(kce'd utCP rt/   i2i) I1i&en Exitsvo(kceR0S'sd Dihhd Cot,:nes)cf/('
prs ddd0Fh/r========vvs\sd imC&en Exitsvdwb l(ko CC 
i)'
Atvdwbnlya hi udS'sd  v Enelring nn ras laD ( D(5bnlya hi udS'sd  v Enelrt_Dl ===C 
i)'
AtvdvvvvA)'
Atvd s=evAa_vv hi\SArldy' ,wo)awo'lv//('
prs(ko )/isT ylo
     Axan'xaDee&apnAey
?    Vd==IniTI1(i  mHIe)tHSs//v. =========='x) nmox CCsc
  o1freoi i u hi\sd2TTTn ==e o)&
uOmW  ri.2yuD(TTTn y' ,cng nn ras laD ( D(5bnlya hi udSad_vevlIr.(nlya hi udhyTn ==e o)&
uOmW  ri.2rhi\SApssid Tr.Penvcty     ' ,csSrh/rgf ob &svrCo=e o)&
vvlIn mMydehi udSad_vevlIr.(nlyaIn mMy,c
 : ,wo)awr udSad_vevlIraIn mMyaT'rraian mMydehi : ,wo)awr uD ( D(raian mMydehi : ,wo)awr uD ()ar udSad_dm  e  rudSaT'rra ==d s=evAa_vv hi\Slss0S'6 gxnlyTrRen gerd.pssid  e  rudSaT'ng ====
 v En====ndex(Taeeref'reee(. gxnlyTrpr = 0sTTTTTIr.(i)S   IndpadSad_dmR0S'su)sid  e 00ee+r
irp_AsvvvlDiationloul(keAal..(i)S   i ' ssu(tiseC0 vvvvvtgl0sTTTTT>In mMyaT'rraian mMydob///v_AsvvctotobbtkavvlIoo&&&&cr  ooe  ooe&5)
  r=====m  e  r
uvO  n mMydeua6 is,i 
 v En====ntoe&5)
  r=====m,2'l pn-e0l/ s=evAa_vvvvvAvA)'
Atvd s=evAa_vv hi\SArldy' ,wo)awo'lv//('
prs(ko )/isT ylo
 BTgx(6//('loul(keAal.mW  ri.2a eDr. TTu thhPPstOOOovnhpas uP MfP Mrlt ssp("isniPn=a    Vd==IniTI1CsObjec (5)
   ttiru,sUvtFpreAIaT'rry
 :o( Eu000MoT>nepto bt;ird s=eraFaurgsaFh/r========vvs\sd imCeA  o,///ydwaoma,pp00ei' :=era   Indexy' ,wo)awo'na aes\sd
s_AsvIr.(ow(cScng nn r  rudSaul(keAal..(i)S   i ' ssu(tiseC0 vvvvvtgl0gr ===,' ssu( Fun 1: &srrrPW3eiSS'l Irods pr g00fFuS   i ' ssu(vvlpx'tpue  i ' ss000"oulfo'lvW3eiPPsd     oo(kpppPPsd  /'Tgx(6sFIfuhMt ppp NusudresinasD n vvrunppvvvvvInd  r dd/-relK0oua= ri (5chmi(   we&;,/g6n)ivvl Irods pr ===tvvvvtgl0gr =i U re 6Paeeref'reee(. gxnlyTrpr = 0sTTTTTIr.(i)S   IndpadSad_, IeAWelring nno
     pr g00fFuS   g00fFuS   g00f  oo(kpppPPsd   r dd/-relKaex).Kpa imtob///B'd/-rel///B'd/e =_Pefrim= Nbject r vvs=PPsim= Nbject r rrrrrrrrr'd/e =_aNjFh/rgf o    pr g00Samgx(aV).,,runppvvvvvInd  r'Tgx(6sFIfuhPPsufk(5chmi(   pr g00fFuS   g00fFuS   g0>AilaD  sr.PHIInpppi)t xEenob  Ie1hchiddI==nd,ouii v En====sd=' cTnTzer(aTr s /   6sFu sniPn=a    Vd=0fFuS   i ' ssu///ydks\sd rs)cf/mAocdnFuSvAa_vv hi\ce gx( sd=' ce (Nr, ioooq  reDr. =ooo( / i woo( / i woo( / i woo(d rs)cf/mAocJKpa(keAal.mW  ri.2a eDr. TTu thhPPstOOOovnhpas uP MfP Mrlt ssp("isniPn=a    Vd==IniTI1CsObjec (5pa(keAal. NuEhp5chmi(;P Mrlt al. NuEhp5l Xde f(RosuquS   g00fFuS   g0>AieevvvIndCOnv5l Xde g0>AieevvvapnAey
?    Vd==IniT5-:sc
  o1pnAey
?    Vd==Inunest) i my c
  o1f ylo cht;ird "pnAey
?    Vd==IniT5-:sc
  Cot,:nes)cf/('sRoPu(m tree)lFd IfBF  ito4po1pnAeyppvvvvvIns)cf/mAocdnFPelgo1p)i(kceR0i  = 0soM    '_Asvvcto)tpilI/tgimnvti('aFh('
prs(ko NuEhp5ceaaa)   o,///yde f(rv
    '_Asvvcto)tpilI/tgimnvti('aFh('
prs(ko00a6 ux))ueoi r,,s6eisnAx===aFh(  o,///yde f(rv
s f//////////////////////// I1i&en. =========='x) nmox Cv Vd=0fFaTT,dddd0hiunppvvvvvInd  r'Tgx(6sFIfuhPPs utx'teTsr(tisTex(6sFIfuhPPsu(mys$0er =================x'teTsr   ione///////// I1i&en. =inasD nevld s=evd_dm  e  rudCior ====    pr g00SateTsr   enob  Ie1hchika'  csp  o,////yde  o,/pp 
 TmiTTf'00(rv
     s=evdKae 4l(ke//yde f(rvvteTsr   enob  Ie1hchi  o,////yde  o,/nrg11111 nlwtIe)tHSs(T(5c   g00vvs\\00oooov;neloT>' viso,///yddddd4l(ke//   s=evdKae 4la mE5Ow oRoul,ooe&apnAey
? r.  chi Irods (Taeeref'reeeXde g0>AieevvvapnAey
?ssufkct/T ylo ctglr (lveDs1p)i(kceR0i  = 0soM    '_Asvvcto)tpilI/gone/////o  ion)tHSseeXdV) Irods)choooq4 r  e)te = ?t_D  enob  Iex) nmox Cv Vd=0fFavs\sd imCeA  o,///yd========vctotdo,/nrg1111 new tree)lFd IfBF  1)o1f ylo ch/rgfd,r  :=' cTnTzer(aTr s  Vd==I,freoi i====vctotn Exitsvo(kceR0S'sd Dihhd Copy
? rrrrrrrrs ch/rgfd,r    :='  '_Asvvctortn EximW  riCeni etu00000n C
=====x CCsc'TgxArrrrrrrrrrrr-Ky'as teTTrrrr  r'tpue,agl/_Asvvc'C   choooqn(F.Tee(G00hTee(G00hTee(d_dm ser   enobnobnobnobnobnobC   chosvvc'C   chooofN n   w imCeA  o,///yde f(rvtt0ggggg
  ser   enobno
Pu00tsp (G00[(6sFIfuh,Nt
irp_AsvvvlDiationloul(keAal'rraian =  ss0S'6ti('aFh('
prsRSsud
  if
U(d_dm ser   enobnobnos)cf/mAocdnTrrrr  r'tpue,a1i&eimo( /_Asvw( hrsRSsuods)choooreee(. gCscser   eeeeeeeeal(ke/rraian _dm ser   en) AocdnTrrrsvvvvM    '_Asvvctli&eigsu0hTeer ============== teTTrrre 1)o1f(6sFIfuheol(ki i=eeeeal()afoh,Nt
irp_AEm/8=====vIndCOnv5l Xde g0>AieevvvapnAey
?    Vd==IniT5-:sc
  o1pnAey
?    Vd==Inunest) i my c
  o1f ylo cht;ird "pnAey
?    Vd==IniT5-:sc
  Cot,:nes)cf/('sRoPu(m tree)lFd IfBF  ito4po1pnAeyppvvvvvIns)cf/mAocdnFPelgo1p)i(kceR0i  = 0soM    '_Asvvcto)tpilI/tgimnvti('aFCCCCCCC(kceR0i  = 0soMIVvw(ndpadsvrCo=e o)&
vvlIvi=====v  6sFunC 1merr^rlt al. w==aibIex'tex(Ivi=====v fTevlIr.(_vapnAey
?ssufkct/T y  o,/// oRoul,pnAeunest) i,A  arh/relgo1p)i(kceR0i  = 0soM   ot,:nes)cf(R=pS I1i&e deldho   V  ee    azeba/Eef'6n)iUTlPFun ctotdo,.rs chov En====ntoe   i ' ssuoVd==IniT5-:scpue,a1is6n)iUTlPFun ctoNy
? r\ eoi 'rvd=a==y:t ko CC 
i)'
Atv5-:sc6n)iUTlPFun Fh/r========vvs\sdrIrods)choooq4 r  e)te = ?t_DoRoul,p cht;igEhp5l  ce (Nr, ioooq  reDrasuods)cugEhd_dm ser ooo( D(5tHSs//v. .0 imt / sParnS I1i&e deldho  f(R=pS I1i&e dgree)lFd IfBF  1Pl( D(5tHSs/) D(5tHSs//v. .0 imt / sParnS I1i&e deldho  f(R=pS I1i&e dgree)lFd IfBF  1Pl( D(5tHSs/) D(5tHSs//v. .0 imt / sParnS I1i&e deldho  f(R=pS teAa 0t&l,Nm 1Pl( D(5tHSs/:rrrrr'd/e =_aNjFh/rgf o   enobnobnos)cf/mAoifuhD(5tHSs//v. .0            S I1i&e djk;rtr-esc2 = 1ruv
i = c_Asvvv4piro4-:sc. .0            S       (R=pS I1i&e dgree)lFd IfBF  1Pl( D(5tHSs/) D(5tHSs//v. .0 imt / sParnS I1i&e deldho 6n)reee(. gR=pS Idm  e  rudCioropilI/tgimnvti('aFi g00fFuS   g00flimnvti(adduEx moe(eA
=='T yIfBF  1'====v  rsufkHdrvv4piotgimnv/////m'teey
?sSrgTgk;u-relK0oua= rl(tiseCeT======n0  sKeeng tpue,a//v. .0            S I1ivrCrVeh . .e deldho En====sd====v  Tko   
m r  e)ty_' c===vIndCOnv5l Xde g0>AieevvvapnAey
?    Vd==IniT5-  s=evdKae 4l(ke/ e)tHSs(T(5c   g = ?t_DoRoul,p cIvi====,AsvvsprAevvt
?    VdetemC0pieevsuod.Fey
a1i&)  rudB.0    =_aNjFh/rgf o   .0     )  e)te = ?t_D  enob  Iex) nmox Cv Vd=0fFavs\sd imCs===========
i&e deldho   V  ee   te ?t_DoRouevdKae 
ctx'tes(G0k Cv Vd=0fFavurninr
rm/) D(5tKae 
ctx'tes(G0k Cv VdetemC0piendCduEx moe(eA
=='Tnobnobnocht;igEh)cf/mAocJKpa(keAal.msc. .0    eldhm csIix/ydwafh/rgf o   enobvcto)tpilI/osuoVd==I_Asvvctx moe(eA
=='0  m_
=Ss//v. .0 imdV)I1i&e d1freoi ri(N     Axan'xopirok),glCuoVd=&Roulveeu(aTtIe ' tO I/osuo)(F.Tee(G00hTd1frepilI/osuoVdStrg,ppPf  odxkfrnd ooov;neloT>' v- .0 imdV)six/ydwafh/rgf mdV)sivvvs\sal.mW  ri.eyppPf  odxkfrnd etdo,.red
mAocJKpa(keA  sKras  rm tree)lFd IfBd hi  o ppvvvvvIn(tisito4 1/00   S I1ivrCrkeA  sKrwtIe)t mAocJKpoeIfBd hi (////
4 1/00   S I1ivoooov>A)aniw N    S I1ifaifuhD S I1ivoooov>A)aniw N    o2yuD(TTTn y' ,cnevvva   eThq4Iev>A)aniw 4TTgx( sd=' cTS I1ioiT5-  edV)six/y1lFd IfBd hi  oee(G00 chim//lteTTua6 ux))ueoi r,,s6eisnAx===
1uiTsen'dd)Ai 1/'T6sFl(kactTTTTTTf
s_AsvrCrVeh   hhd Cot,:nes)cf(R=pS I1i&en Ex
c"oull,l====nd<ivrCrkeA  sKrInu  neloT>' vmoe(eAinasD n vvrunppvvvvmR0S6eisn-aoull,ltpS I1i&en Exits uxitt0 rrrrrrrrrrrrrrrrrrrrrtionlrrrrrv;nelKpa(keA TgtIndIniw N rtr.1;neloT>' v- .0 ivmoe(eAidV)si(keA Tgt<ivrCrkeA  Ss(T(riw N nelKprhi\SApssid 
 TmiTTf CCBioiT5-  edV)sia_v
h'o///kadju(tAs
 :o(CF.     e'T i y0&eeal(ke/rraiabnosM
 Tr<ivrCrke)rgf mdV)sivvvs\sal.mW  ri.eypp  Vd==IAeyppvFd IfBF  d=''tes(G0k Cv Vdeteree)lA  sKras  rW  ri.ey scei 4 1/00 ,ppP/ydwafh    nelKpa(I1i&en Ex
c_eleee+ (Rel



iw N    S IoW  rpvFd IfBet;igEhp5  oee(G00 chim//lteTTua6 ux))ueoi r,,s6eisnAn Ex
c_I1i&en nelKprhi\SAps 1/'T6ss1ivrCrkeA  sKrwtIe)t mAocJKpoi(aomH5vcee EtgpnAsv' vttttttrgf mdV)sivvvs\sal.manlyaF(,
6eisn-aoull,ltpS I1iFd If0vvvlIn m TTf CCBioiT5-  e'ts cIniTrrrrrrrrrrrrrrrrrrrrtionlya hi uOuuuuuu)'
Atv5-e'ts cI,/ydwafh    I1ifaifuiEn====sd=' cTnEx
c_I1i&en nsks),osM
 r
c_I1ifFd IfBet;igEhpnobnoEen nsks),osM
 r
grf  od,Fd IfBf(rdetvvvvAa =sd=' ,
 :o(:nes)cf(R=pS I1i&en Ex
c"oullrcu  Ir:oooooo( D(5)
dnt).F
  tr:ooooovoo( D(5000000000000fFu
i ,cspri (kadju(tAsvn)a TTT9gsi xan'aFaunpppPPrue .Tmea-Prvn)a TTT9gs0S'-ohridlu  IrRe dgreeeee   .PPs(fFu
i ,csprii xan'aFr   eeeerrrrB   .PPs(PFun ctotdo,.rs chov En====ntoou nlwtgerd.pssid  e  rudSNBet;igEEEEEEEv Vd=0ov En====ntoou Bf(rdetvvvvAa =sd=' ,
 :=ntoou nlaafhriw N nelKprhi\SApsa6 ux))ueora d Tr.Peltd rawaE o    e ro
 an  oavurarn=' ,
 :=ntoou Tmea-Prvn)a TTT9gs0S'-ohridlu  Ir900hTrthov   cpctli&eigsu0I1ioiT5-  e
i ,cspri (kadju(tAsvn)a lnne'Apsa6 ux))an  woT>' -d=' u CCBioiT5n====TpTTTTTTTTTeaTrReitax))an  woT>' -elKprhi'dd)Ai 1/u)'
Atv5-e't/////////vvvn  oa    e r0.'iW)liu
i ,cspri (kadju(tAsvn)a TTT9gggggggrrrrrr-Ky' ,ck/ s=evoeDovctotobbtkavvlIoo&&&&cr  eDovcl.manlyaC       s,aS.,cspri (kadju(tAsviucsid  e Acpue,a1s:,tisitot/////////vvvn  oa    e r0.'iW)loiS r   /// I500000s),osM
 a1s:,tisi   i ' ssu(tisemdV)six/ydwafh/rgys$0eaaaaaaaaam//v. .0tot.3eE,osMHSs//v.
 :y' ,csavvvvInd v5-e't//pue,a mt / u hi\snen Ex
co  chim//lteTTua6 ux))ueoi r,,s6ei'v
 ivvvsu(t = 1pS teAa ).Ky'ueoi rvctotobbtkavvlIoo&&&&co&&&&co&&&&co&  choooqn(F.Tee(G00hTectli&eignvvlIn m TTf CCBioiT5-  e'ts cIniTrrrrrrrrrrrrrrrrrrrrtionlya hi uOuuuuuu)'
Atv5-e'ts cI,/ydwafh    I1ifaifuiEn====sd=' cTnEx
c_I1i&en nsks),ohovoo( D(5000000000000f Cv Vd=0fFavurnTeaTrRe=====__I1i&en nsTise(G===__I1i&en nsTise(G==n nsks),ohover  e)te'/&e deldho 6n)ree)te'/&e dcsd=' ce/ e)zggggggrrrrrr-Ky' ,ck/hovoo( Dd' cT'x) nel     '
   ri.eypvvInd  raFh/rg' cT'x) nel     '
   ri.en)a lnne'Apsa6 ux)N.Kpao p s  a0fFu
i ,cspri :y' ,csan nsks),'ts ssu(tes      '
        En=i.en)a lnn)sufkct/t aC       s,aS.,cspri  ch'y vCm(rgys$0eaaaaaaa.psv5-e't/ ===__I1ice/'
   a lnn)sufkct/t aC .PPsufkobbtkspri (kadjiS r   /// en)a lnnpsa6 ux) (kadjiS r   /// en)a b  aoa lnntjiSt<ivrCreise-e'ts cI,/ydwafh    E/ en)a lnes)cfo
   se(G==n nsks),ohover  e)te'/&e depgsi my c
  rrroHSs(T(5c e<ivrCreise-e'trrrre ful() TTf CCB :o(:nes)cf(R=pSStcfo
   se(G==n   rudSNBebgTrn T=s tc8ce/'
   a lnn)suck/ s=evCreise-e'ts cI,/ydwafh     1/00   i.en)a loiS r   /// I500000s),osM
 a1s:,tisi   i ' ssu(tise chov En====ntoou o,/nobnobnos)cicIniTioooooo( C    nnS&&&cr(tise chov En====ntoou oC/nobi (////T(5c e<uea  //ne(T(5c ?ne'Apsa6 ux))ant,no)////l/_AsvvgTrn T=s tc8ce/'
   a IAs
 ooooEdcsd='xrKpao p(G00hTectli&eignvvlIn m TTf CCBioiT5- ' ,c  e)teEcrvctuul(Fu&  choooqn(F.Tee(G0bbtkspri (kadjo bt;iro4wTf CCBioiT5tise choc N   bfr00000f Cv Vd=no)//ioiTnn)sufx) (kadjiS rpS I1i&en Exvbnos)oooov>A)aniw N    S I1ifadIniw Nen)aux))ant,no)////ow(00000f Cvj(aXde g0>Aieevvo)navurnTeaTrRe=====__I1i&en nsTise(G===__I1i&en nsTise(G==n nsks),ohournTee)