#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, x, y;
  cin >> n >> m;
  vector<int> v[n + 1];
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  int star = 0, cnt = 0;
  for (int i = (1); i <= (n); ++i) {
    cnt += (v[i].size() == 2);
    star |= (v[i].size() == n - 1);
  }
  if (star && m == n - 1)
    cout << "star topology";
  else if (cnt == n - 2 && m == n - 1)
    cout << "bus topology";
  else if (cnt == n && m == n)
    cout << "ring topology";
  else
    cout << "unknown topology";
  return 0;
}
