#include <bits/stdc++.h>
using namespace std;
long long t1, t2, n, i, j, k;
int main() {
  long long m, mm = 0, flag = 1;
  cin >> n >> m;
  vector<set<long long>> v(n + 1);
  for (i = 0; i < m; i++) {
    cin >> t1 >> t2;
    v[t1].insert(t2), v[t2].insert(t1);
  }
  multiset<long long> a;
  for (i = 1; i <= n; i++) a.insert(v[i].size());
  auto x = a.begin(), y = x++;
  if (*a.begin() == *a.rbegin() && *a.begin() == 2 && n == m)
    cout << "ring topology";
  else if (*a.rbegin() == m && m == n - 1 && n != 2)
    cout << "star topology";
  else if (*x == *y && *x == 1 && *a.rbegin() == 2 && m == n - 1)
    cout << "bus topology";
  else if (*x == *y && *x == 1 && n == 2)
    cout << "bus topology";
  else
    cout << "unknown topology";
  return 0;
}
