#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > v(n);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int a = 0, b = 0, c = 0;
  for (int i = 0; i < n; i++) {
    if (v[i].size() == 1) {
      a++;
    } else if (v[i].size() == 2) {
      b++;
    } else {
      c++;
    }
  }
  if (a == 2 && c == 0) {
    cout << "bus topology";
    return 0;
  }
  if (b == n) {
    cout << "ring topology";
    return 0;
  }
  if (a == n - 1 && c == 1) {
    cout << "star topology";
    return 0;
  }
  cout << "unknown topology";
  return 0;
}
