Imagine there are 10 sites with the identifiers A, B, C, D, E, F, G, H, I, and J. There is a link from
- I to J;
- B to C;
- E to F;
- C to G;
- G to H;
- H to G;
- H to I;
- C to A;
- A to B;
- D to E;
- F to D;
- F to J;
- J to I;
- B to D.
To better understand this scenario, please create a visual representation of the network by drawing it on paper. Now, let's name a group of sites a hub if each site of this group is reachable via links from any other site of this group. To make the definition clear, let's consider the following example:
Here, the sites , , and form a hub, since each site from this group is reachable to any other via links. Despite the fact that there is a link from to , the site is not included to the hub because there is no link from to and hence neither of , , or is reachable from .
Your task here is to find all hubs for the 10 mentioned sites and enter them in the field below. The expected output format is the following:
A B
C D
F G H
Here each line corresponds to a hub, and sites' identifiers are separated by spaces.