#include #include #include #include #include using namespace std; map corri; typedef int point; struct edge { point dest; edge(){}; edge(const point & dest): dest(dest){}; }; typedef vector edges; typedef map graph; graph thegraph, connected_graph; pair split(const string & s) { string r1, r2; int pos = s.find('-'); return make_pair(s.substr(0, pos), s.substr(pos + 1)); } int strees_to_num(const string& c) { if(corri.count(c) == 0) { // add corri.insert(c, corri.size()); } return corri[c]; } void add_edge(string src, string dest) { int s = street_to_num(src); int d = street_to_num(dest); thegraph[src].push_back(edge(dest)); } void solve() { // copy connected_graph = thegraph; for(graph::iterator it = thegraph.begin(); it != thegraph.end(); it++) { } } int main(void) { int n; cin >> n; if(n == 0) return; for( int i = 0; i < n; i++) { corri.clear(); thegreph.clear(); connected_graph.clear(); string crossing; cin >> crossing; pair p = split(crossing); add_edge(p.first, p.second); } solve(); } map > classify() { }