#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 1, 0, 0, -1, -1, 1, 1};
const int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
class DSU {
 public:
  int parent[100005 + 5];
  void makeSet(int nodes) {
    for (int i = 1; i <= nodes; ++i) {
      parent[i] = i;
    }
  }
  int Find(int u) {
    if (u == parent[u]) return u;
    return parent[u] = Find(parent[u]);
  }
  void Union(int u, int v) {
    int p = Find(u);
    int q = Find(v);
    if (p != q) parent[q] = p;
  }
  bool isFriend(int u, int v) { return (Find(u) == Find(v)); }
};
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int node, edge;
  cin >> node >> edge;
  set<pair<int, int>> totEdge;
  DSU dsu;
  dsu.makeSet(node);
  bool cycle = false;
  bool bus = false, star = false, ring = false;
  vector<int> G[node + 15];
  for (int i = 0; i < edge; ++i) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
    if (u > v) swap(u, v);
    totEdge.emplace(u, v);
    if (dsu.Find(u) != dsu.Find(v))
      dsu.Union(u, v);
    else
      cycle = true;
  }
  if (cycle) {
    for (int i = 1; i <= node; ++i) {
      if (G[i].size() == 2) {
        ring = true;
      } else {
        ring = false;
        break;
      }
    }
  } else if (totEdge.size() == node - 1) {
    bus = true;
  }
  if (bus) {
    for (int i = 1; i <= node; ++i) {
      if (G[i].size() == node - 1) {
        bus = false;
        star = true;
        break;
      } else if (G[i].size() > 2 || G[i].empty())
        bus = false;
    }
  }
  if (ring)
    cout << "ring topology" << '\n';
  else if (bus)
    cout << "bus topology" << '\n';
  else if (star)
    cout << "star topology" << '\n';
  else
    cout << "unknown topology" << '\n';
  return 0;
}
