UOJ Logo Universal Online Judge

UOJ

#3236. [Ahoi2013]作业

统计

Description

Input

Output

Sample Input

3 4
1 2 2
1 2 1 3
1 2 1 1
1 3 1 3
2 3 2 3

Sample Output

2 2
1 1
3 2
2 1

Hint


N=100000,M=1000000

Source

By wangyisong1996加强数据