#include<map>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
struct Empty
{
public:
Empty(int=0) {}
bool operator<(const Empty&) const { return true;}
};
inline ostream& operator<<(ostream& os, const Empty&) { return os;}
inline istream& operator>>(istream& is, Empty& ) { return is;}
template<class VertexType, class EdgeType>
class Graph
{ public:
typedef std::map<int, EdgeType > Successor;
typedef std::pair<VertexType, Successor> vertex;
typedef std::vector<vertex> GraphType;
typedef typename GraphType::iterator iterator;
typedef typename GraphType::const_iterator const_iterator;
private:
bool directed;
GraphType C; ostream* pOut;
};
template<class VertexType, class EdgeType>
ostream& operator<<(ostream& os, Graph<VertexType,EdgeType>& G)
{
for(int i = 0; i < G.size(); ++i) {
os << G[i].first << " <";
typename Graph<VertexType, EdgeType>::Successor::iterator
startN = G[i].second.begin(), endN = G[i].second.end();
while(startN != endN)
{
os << G[(*startN).first].first << ' ' << (*startN).second << ' ';
++startN;
}
os << ">\n";
}
return os;
}
int main()
{
Graph<std::string, Empty> V(true);
cout << V;
}