class fidoaddr {
public:
    int zone;
    int net;
    int node;
    int point;

    fidoaddr()
    {
        zone=net=node=point=0;
    }
    fidoaddr(string saddr)
    {
        operator=(saddr);
    }

    fidoaddr& operator =(string saddr);
    friend int operator >(fidoaddr&a,fidoaddr&b);
};

fidoaddr& fidoaddr::operator =(string saddr)
{
        zone=atoi(saddr);
        saddr=saddr.after(":");
        net=atoi(saddr);
        saddr=saddr.after("/");
        node=atoi(saddr);
        saddr=saddr.after(".");
        point=atoi(saddr);
}

int operator >(fidoaddr&b,fidoaddr&a)
{
    if (b.zone>a.zone)
        return 1;
    else if (b.zone<a.zone)
        return 0;
    else if (b.net>a.net)
        return 1;
    else if (b.net<a.net)
        return 0;
    else if (b.node>a.node)
        return 1;
    else if (b.node<a.node)
        return 0;
    else if (b.point>a.point)
        return 1;
    else
        return 0;
}

inline int operator <(fidoaddr&a,fidoaddr&b)
{
    return b>a;
}


class infonode {
public:
    fidoaddr addr;
    string _addr;
    int recd;
    int sent;

    infonode()
    {
        recd=sent=0;
        //addr.zone=addr.net=addr.node=addr.point=0;
    }
    infonode(string saddr)
    {
        infonode();
        _addr=saddr;
        addr.zone=atoi(saddr);
        saddr=saddr.after(":");
        addr.net=atoi(saddr);
        saddr=saddr.after("/");
        addr.node=atoi(saddr);
        saddr=saddr.after(".");
        addr.point=atoi(saddr);
    }

    friend int operator >(infonode&b,infonode&a);
    friend int operator <(infonode&a,infonode&b);
};

int operator >(infonode&b,infonode&a)
{
    if (b.addr.zone>a.addr.zone)
        return 1;
    else if (b.addr.zone<a.addr.zone)
        return 0;
    else if (b.addr.net>a.addr.net)
        return 1;
    else if (b.addr.net<a.addr.net)
        return 0;
    else if (b.addr.node>a.addr.node)
        return 1;
    else if (b.addr.node<a.addr.node)
        return 0;
    else if (b.addr.point>a.addr.point)
        return 1;
    else
        return 0;
}

inline int operator <(infonode&a,infonode&b)
{
    return b>a;
}
