This page is still under construction.

Parts of this page are still being built. What you see may change.

Spica

Time limit1sMemory limit1024 MB

Summary
Given the 12 edges of a fixed 12-vertex graph with shuffled labels, determine which vertex is Spica, the topmost star in the figure.
Level

Medium6 of 10

Topics
Graph, Implementation, Brute force, Sorting
Solved
No attempts yet

Problem

The figure above shows 12 stars of Virgo connected by 12 line segments.

Sieun assigned a distinct integer from 1 to 12 to each star at random, and recorded with 12 integer pairs which two stars each segment connects. However, she forgot which number she assigned to which star.

Given the information about the segments, find out which numbered star Spica, the brightest star, was.

Input

The input consists of 12 lines.

Each line contains two distinct integers x and y, meaning that there is a line segment connecting the two stars x and y.

The input graph is guaranteed to have the same shape as the figure.

Output

Print which numbered star Spica is in the graph given as input.

Print a single integer corresponding to the number.

Examples1

  1. Example 1

    Input
    1 2
    2 3
    3 4
    4 5
    3 7
    4 9
    6 7
    7 8
    9 8
    9 10
    10 11
    12 11
    
    Expected output
    7