Make the soup:
Put the chicken in a large (at least 8-quart) stockpot and add 8 cups water. Bring to a boil over high heat and then reduce the heat to a vigorous simmer. Simmer for 10 minutes, frequently skimming off the foam that floats to the surface.
Add all the vegetables, the garlic, the cilantro, and the bouillon cubes to the pot, along with the salt and pepper. Stir a few times to distribute the vegetables and submerge as many of the solids as possible. When the broth returns to a gentle boil, partially cover the pot and simmer, stirring once or twice, for 1-1/2 hours. Taste for salt and add more if needed.
Using tongs or a slotted spoon, pick out the chicken pieces and put them on a large plate. Stir the soup with a large spoon, breaking up some of the potatoes to thicken the soup slightly. Keep hot if serving soon or let cool and refrigerate.
When the chicken is cool enough to handle, pull the meat off the bones and shred it by hand. Discard the bones and tendons, and put the shredded chicken in a serving bowl.
Serve the ajiaco:
Put the avocados, sour cream or creme fraiche, capers and cilantro leaves in small bowls and set them on the table along with the bowls of shredded chicken and the aji. Reheat the soup if necessay and ladle it into large soup bowls, putting a quater ear of corn in each bowl. Let your guests add the garnishes and the aji as they like.
The soup and the aji can be made a day ahead. If the soup is too thick after it’s reheated, thin it with a little water.