This is the shortest possible sequence that contains each of the pairs.

これがすべての組み合わせを含んだ最短解