struct node
{
    int from,to,w;
    bool operator < (const node & b) const
    {
        return w<b.w;
    }
} ;