#include <bits/stdc++.h>
using namespace std;
int main() {
  int v, e, i, node1, node2;
  map<int, int> m;
  scanf("%d%d", &v, &e);
  vector<vector<int> > adjList(v);
  for (i = 0; i < e; i++) {
    scanf("%d%d", &node1, &node2);
    node1--;
    node2--;
    adjList[node1].push_back(node2);
    adjList[node2].push_back(node1);
  }
  for (i = 0; i < v; i++) {
    if (adjList[i].size() > 2 && adjList[i].size() < v - 1) {
      printf("unknown topology");
      return 0;
    }
    if (m.find(adjList[i].size()) == m.end())
      m[adjList[i].size()] = 1;
    else
      m[adjList[i].size()]++;
  }
  if ((m[1] + m[v - 1] == v) && (m[v - 1] == 1))
    printf("star topology");
  else if ((m[1] + m[2] == v) && (m[1] == 2))
    printf("bus topology");
  else if (m[2] == v)
    printf("ring topology");
  else
    printf("unknown topology");
  return 0;
}
