#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > edges;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  edges.resize(n + 1);
  int nrdeg1 = 0;
  int a, b;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    if (edges[i].size() == 1) nrdeg1++;
  if (nrdeg1 == 0) {
    set<int> remained;
    for (int i = 1; i <= n; i++) remained.insert(i);
    remained.erase(1);
    int cur = 1;
    int prev = -1;
    int next;
    bool ring = true;
    while (remained.size() > 0) {
      if (edges[cur].size() != 2) {
        ring = false;
        break;
      }
      next = edges[cur][0];
      if (next == prev) next = edges[cur][1];
      if (remained.count(next) == 0 && (next != 1 || remained.size() > 1)) {
        ring = false;
        break;
      }
      prev = cur;
      cur = next;
      remained.erase(cur);
    }
    if (ring) {
      cout << "ring topology" << endl;
      return 0;
    }
  }
  if (nrdeg1 == 2) {
    vector<int> jean;
    for (int i = 0; i <= n; i++)
      if (edges[i].size() == 1) jean.push_back(i);
    edges[jean[0]].push_back(jean[1]);
    edges[jean[1]].push_back(jean[0]);
    set<int> remained;
    for (int i = 1; i <= n; i++) remained.insert(i);
    int cur = 1;
    int prev = -1;
    int next;
    bool ring = true;
    while (remained.size() > 0) {
      if (edges[cur].size() != 2) {
        ring = false;
        break;
      }
      next = edges[cur][0];
      if (next == prev) next = edges[cur][1];
      if (remained.count(next) == 0 && (next != 1 || remained.size() > 1)) {
        ring = false;
        break;
      }
      if (next == 1 && remained.size() == 1) {
        ring = true;
        break;
      }
      prev = cur;
      cur = next;
      remained.erase(cur);
    }
    if (ring) {
      cout << "bus topology" << endl;
      return 0;
    }
    edges[jean[0]].pop_back();
    edges[jean[1]].pop_back();
  }
  if (nrdeg1 == n - 1) {
    bool star = false;
    for (int i = 1; i <= n; i++)
      if (edges[i].size() == n - 1) star = true;
    if (star) {
      cout << "star topology" << endl;
      return 0;
    }
  }
  cout << "unknown topology" << endl;
  return 0;
}
