fromCycleStructure c = map findValue [1..n] where
  n = maximum $ concat c
  findValue = recurse c where
    recurse (c':cs') i
      | i `notElem` c' = recurse cs' i
      | otherwise      = case dropWhile (/= i) c' of [_]     -> head c'
                                                     (_:a:_) -> a
fromCycleStructure c = map findValue [1..n] where
  n = maximum $ concat c
  findValue = recurse c where
    recurse (c':cs') i
      | i `notElem` c' = recurse cs' i
      | otherwise      = case dropWhile (/= i) c' of [_]     -> head c'
                                                     (_:a:_) -> a
fromCycleStructure c = map findValue [1..n] where
  n = maximum $ concat c
  findValue = recurse c where
    recurse (c':cs') i
      | i `notElem` c' = recurse cs' i
      | otherwise      = case dropWhile (/= i) c' of [_]     -> head c'
                                                     (_:a:_) -> a