#include #include #include using namespace std; const int maxn = 1100, inf=2147000000; //Grape int n, m; struct Edge{ int u, v, w; char c; }e[maxn]; bool cmp(Edge a, Edge b){return a.w