func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 1000 * 1000 * 1000;   vector<int> g[100100];   int deg[100100];   bool vis[100100];   void dfs(int v) {     vis[v] = true;     for (int to : g[v])       if (!vis[to]) {         dfs(to);       }   }   int main() {     int N, M;     scanf( %d%d , &N, &M);     for (int i = 0; i < (M); ++i) {       int u, v;       scanf( %d%d , &u, &v);       --u;       --v;       g[u].push_back(v);       g[v].push_back(u);       ++deg[u];       ++deg[v];     }     int q = 0;     for (int i = 0; i < (N); ++i)       if (!vis[i]) {         dfs(i);         ++q;       }     if (q > 1) {       puts( unknown topology );       return 0;     }     sort(deg, deg + N);     if (deg[0] == 1 && deg[1] == 1) {       bool check = true;       for (int i = 2; i < N; ++i)         if (deg[i] != 2) {           check = false;           break;         }       if (check) {         puts( bus topology );         return 0;       }     }     bool check = true;     for (int i = 0; i < (N); ++i)       if (deg[i] != 2) {         check = false;         break;       }     if (check) {       puts( ring topology );       return 0;     }     check = true;     if (deg[N - 1] == N - 1) {       for (int i = 0; i < (N - 1); ++i)         if (deg[i] != 1) {           check = false;           break;         }       if (check) {         puts( star topology );         return 0;       }     }     puts( unknown topology );     return 0;   }   