Different representations of dendrograms
This output represents the dendogram as a tree. The innermost parentheses represent the deepest parts of the tree. For instance the top (root) of the tree start with the pair K5 and a subtree, then this subtree is made of another subtree and K4, and so on.
If we ignore the numerical values (distances I assume?) we have this:
(K_5,
  (
    (K_1,
       (
         K_2,K_3
       )
       
    )
    K_4
  )
)

Which represents this tree:
 --------------------
 |                  |
 |            -------------
K_5           |           |
           -------       K_4
           |     |
          K_1  -----
               |   |
              K_2 K_3

Then it can be converted to the desired format:
[K_1 , K_2 , K_3 , K_4 , K_5]
[K_1 , K_2 , K_3 , K_4] [K_5]
[K_1 , K_2 , K_3] [K_4] [K_5]
[K_1] [K_2 , K_3] [K_4] [K_5]
[K_1] [K_2] [K_3] [K_4] [K_5]