#include <bits/stdc++.h>
using namespace std;
int x, y, n, m;
int d[111111];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    d[x]++;
    d[y]++;
  }
  int oneC = 0;
  int twoC = 0;
  int noneC = 0;
  for (int i = 1; i <= n; ++i)
    oneC += d[i] == 1, twoC += d[i] == 2, noneC += d[i] == n - 1;
  if (oneC == 2 && twoC == n - 2) {
    puts("bus topology");
  } else if (twoC == n) {
    puts("ring topology");
  } else if (oneC == n - 1 && noneC == 1) {
    puts("star topology");
  } else {
    puts("unknown topology");
  }
  return 0;
}
