#P383. 练66.1  黑马篮球队

练66.1  黑马篮球队

Description

Three-on-three basketball originated from street games among African American children in the United States. Currently, there are nn players, and mm pairs of players know each other. The popularity of a player is defined as the number of people who know him.
The coach needs to select three players from these nn players to form a "dark horse" team for the competition. The three players must all know each other, but the coach wants the sum of their popularity to be as low as possible, hoping for a "stunning" performance.

Input Format

The first line contains two integers nn and mm, both not greater than 40004000.
The next mm lines each contain two integers xx and yy (x<yx < y), indicating that player xx and player yy know each other (there may be duplicate relationships in the data).
For 50%50\% of the data, n,m200n, m \leq 200.
For 100%100\% of the data, n,m40000n, m \leq 40000.

Output Format

If you can find three players who all know each other, output the minimum possible sum of their popularity among all such choices; otherwise, output 1-1.

Sample

5 6
1 2
1 3
2 3
2 4
3 4
4 5
8