#include using namespace std; const int MAXV = 100; class edge { public: int dest; edge * next; edge(int d, edge* n = 0) : dest(d), next(n) {} }; class vertex { public: string name; long long nsquawk; edge* adj; vertex(string n="") { name = n; nsquawk = 0; adj = new edge(-1); // dummy header } void addEdge(int w) { adj->next = new edge(w, adj->next); } }; class graph { public: vertex vlist[MAXV]; int nvert; graph() { nvert = 0; } int getVertexNum(string n) { for(int i=0; inext; p != 0; p = p->next) out << ' ' << vlist[p->dest].name; out << endl; } } }; ostream& operator<<(ostream& out, graph g) { g.print(out); return out; } int main() { int n, m; string start, n1, n2; int time; cin >> n >> m >> start >> time; graph g; for(int i=0; i> n1 >> n2; g.addEdge(n1, n2); } //cout << g << endl; int v = g.getVertexNum(start); g.vlist[v].nsquawk = 1; long long count[MAXV]; for(int t=1; t<= time; t++) { for(int i=0; inext; p != 0; p = p->next) { count[p->dest] += num; } } for(int i=0; i