I - Insider's Information
Languages: C, C++, Java, Haskell, Pascal, Python, JavaScript, Tiger, C#
Time & Memory limits:
(details)
Ian works for a rating agency that publishes ratings of the best universities. Irene is a journalist who plans to write a scandalous article about the upcoming rating.
Using various social engineering techniques (let's not get into more details), Irene received some insider's information from Ian.
Specifically, Irene received several triples $(a_i, b_i, c_i)$, meaning that in the upcoming rating, university $b_i$ stands between universities $a_i$ and $c_i$. That is, either $a_i$ comes before $b_i$ which comes before $c_i$, or the opposite. All triples told by Ian are consistent — let's say that actual rating \emph{satisfies} them all.
To start working on the first draft of the future article, Irene needs to see at least some approximation to the actual rating. She asked you to find a proposal of a rating in which at least half of the triples known by Irene are satisfied.