#include <bits/stdc++.h>
using namespace std;
vector<int> v[100009];
map<int, int> mp;
int main() {
  int n, m, x, y, index = 1;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    if (mp[x] == 0) {
      mp[x] = index;
      v[index++].push_back(y);
    } else
      v[mp[x]].push_back(y);
    if (mp[y] == 0) {
      mp[y] = index;
      v[index++].push_back(x);
    } else
      v[mp[y]].push_back(x);
  }
  int bus_out = 0, bus_in = 0, ring = 0, s, cen_c = 0, cen_out = 0;
  for (int i = 1; i < index; i++) {
    s = v[i].size();
    if (s == 1) {
      cen_out++;
      bus_out++;
    } else if (s == 2) {
      bus_in++;
      ring++;
    } else {
      cen_c++;
    }
  }
  if (n < m) {
    printf("unknown topology\n");
  } else if (n - 1 == m && bus_out == 2 && bus_in == n - 2) {
    printf("bus topology\n");
  } else if (ring == n && n == m) {
    printf("ring topology\n");
  } else if (n == m + 1 && cen_c == 1 && cen_out == n - 1) {
    printf("star topology\n");
  } else {
    printf("unknown topology\n");
  }
  return 0;
}
