#include <bits/stdc++.h>
using namespace std;
vector<int> graph[(int)1e5];
int m, n, busends;
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  bool star = true, bus = true, ring = true;
  int center = 0;
  for (int i = 1; i <= n and (star or ring or bus); i++) {
    if (((graph[i].size()) > 1 and (graph[i].size()) < n - 1) or
        (graph[i].size()) == 0)
      star = false;
    else if ((graph[i].size()) == n - 1) {
      if (center)
        star = false;
      else
        center = i;
    }
    if ((graph[i].size()) != 2) {
      ring = false;
      if ((graph[i].size()) == 1) {
        busends++;
      } else
        bus = false;
    }
  }
  if (!center) star = false;
  if (busends != 2) bus = false;
  if (star)
    cout << "star topology\n";
  else if (ring)
    cout << "ring topology\n";
  else if (bus)
    cout << "bus topology\n";
  else
    cout << "unknown topology\n";
}
