#include <iostream>#include <algorithm>#include <queue>#include <math.h>#include <stdio.h>#include <string.h>using namespace std;#define MOD 1000000007#define maxn 1010bool G[maxn][maxn];int low[maxn],pre[maxn];int ans[maxn];int dfst;int node;int child;void init(){ dfst=0; node=0; child=0; memset(G,0,sizeof(G)); memset(ans,0,sizeof(ans)); memset(pre,0,sizeof(pre));}int dfs(int u){ int lowu; lowu=pre[u]=++dfst; int v; for(v=1;v<=node;v++){ if(G[u][v]){ if(!pre[v]){ int lowv=dfs(v); lowu=min(lowu,lowv); if(lowv>=pre[u]){ if(u!=1) ans[u]++; else child++; } } else lowu=min(lowu,pre[v]); } } return lowu;}int main(){ int u,v; int Case=0; while(scanf("%d",&u),u){ init(); scanf("%d",&v); node=max(u,v); G[u][v]=G[v][u]=1; while(scanf("%d",&u),u){ scanf("%d",&v); node=max(node,v); node=max(node,u); G[u][v]=G[v][u]=1; } dfs(1); int found=0; if(child>1) ans[1]=child-1; if(Case) printf("n"); printf("Network #%dn",++Case); for(int i=1;i<=node;i++) if(ans[i]){ found=1; printf(" SPF node %d leaves %d subnetsn",i,ans[i]+1); } if(!found) printf(" No SPF nodesn"); } return 0;}