#include #include using namespace std; const int maxn=1005; int map[maxn][maxn],n,cnt[maxn][maxn]; char name[maxn][100]; int match_name(char str[]) { for(int i=1;i>str1>>str2) { if(strcmp(str1,"GRAPH")==0 && strcmp(str2,"BEGIN")==0) break; i=match_name(str1); j=match_name(str2); cout<