Road Roles


Andy has finished wiring a connected undirected network of nn cities with mm weighted roads. He now wants to know how each road relates to the Minimum Spanning Trees of the network.

For each road, classify it as one of:

  • forced — the road appears in every MST;
  • optional — the road appears in some MST, but not all;
  • useless — the road appears in no MST.

Input

The first line contains integers nn and mm.

The following mm lines each contain three integers aa, bb, and cc, describing an undirected road between cities aa and bb with weight cc.

Cities are numbered from 11 to nn. The graph is connected. Multiple roads between the same pair of cities, and self-loops, are allowed.

Output

Output mm lines. The ii-th line should contain forced, optional, or useless, the classification of the ii-th road in the input.

Constraints

  • 1≤n≤1051 \le n \le 10^5
  • n−1≤m≤2×105n - 1 \le m \le 2 \times 10^5
  • 1≤a,b≤n1 \le a, b \le n
  • 1≤c≤1091 \le c \le 10^9

Example 1

Input 1
3 3
1 2 1
2 3 2
1 3 3
Output 1
forced
forced
useless
Explanation

The unique MST uses the two lighter roads. The heaviest road can never appear.

Example 2

Input 2
4 5
1 2 1
2 3 1
1 3 1
1 4 2
2 4 2
Output 2
optional
optional
optional
optional
optional
Explanation

Any two of the weight-11 roads connect cities 1,2,31,2,3, and either weight-22 road can finish the tree. No road is required in every MST, and none is useless.

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.