#include <bits/stdc++.h>
using namespace std;
bool cmp(long a, long b) {
  if (a > b) {
    return 1;
  }
  return 0;
}
int main() {
  long n, m;
  cin >> n >> m;
  vector<pair<long, long> > v(m);
  vector<long> p(n);
  for (int i = 0; i < m; i++) {
    cin >> v[i].first >> v[i].second;
    if (v[i].first > v[i].second) {
      swap(v[i].first, v[i].second);
    }
    v[i].first--;
    v[i].second--;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < m; i++) {
    p[v[i].first]++;
    p[v[i].second]++;
  }
  for (int i = 0; i < n; i++) {
    if (p[i] == m) {
      cout << "star topology";
      return 0;
    }
  }
  long a2 = 0, a1 = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] == 2) {
      a2++;
    }
    if (p[i] == 1) {
      a1++;
    }
  }
  if (a2 == n) {
    cout << "ring topology";
    return 0;
  } else if (a2 == n - 2 && a1 == 2) {
    cout << "bus topology";
    return 0;
  } else {
    cout << "unknown topology";
  }
  return 0;
}
