### 题目大意

$(4 \le n \le 3000, 3 \le m \le 5000)$

### 解题思路

You are given the oriented graph, find four distinct vertices a, b, c, d such that each vertex if reachable from previous and the sum of shortest paths between consequitive vertices is as large as possible. First let’s run a BFS from each vertex and find three most distant vertices over given graph and its reverse. Afterwards loop through each possible b and c. Having them fixed, loop through a among three most distant vertices from b in the reversed graph and through d among three most distant vertices from c in tie initial graph. This is sufficient, because if we’ve fixed b and c and d is not one of three furthest from c then we could replace it with one of them and improve the answer.