#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> d(n, 0);
  vector<pair<int, int> > e(m);
  for (int i = 0; i < m; ++i) {
    cin >> e[i].first >> e[i].second;
    e[i].first--;
    e[i].second--;
    d[e[i].first]++;
    d[e[i].second]++;
  }
  if (m > n) {
    cout << "unknown topology\n";
    return 0;
  }
  if (m == n) {
    for (int i = 0; i < n; ++i)
      if (d[i] != 2) {
        cout << "unknown topology\n";
        return 0;
      }
    cout << "ring topology\n";
    return 0;
  }
  for (int i = 0; i < n; ++i)
    if (d[i] == n - 1) {
      cout << "star topology\n";
      return 0;
    }
  for (int i = 0; i < n; ++i)
    if (d[i] > 2) {
      cout << "unknown topology\n";
      return 0;
    }
  cout << "bus topology\n";
  return 0;
}
