#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> mp;
vector<int> v;
bool is_bus() {
  return v[0] == v[1] && v[0] == 1 && v[2] == v.back() && v.back() == 2;
}
bool is_ring() { return v[0] == v.back() && v[0] == 2; }
bool is_star() { return v[0] == v[n - 2] && v[0] == 1 && v.back() == n - 1; }
int main() {
  int m;
  cin >> n >> m;
  while (m--) {
    int l, r;
    cin >> l >> r;
    mp[l]++;
    mp[r]++;
  }
  for (auto x : mp) {
    v.push_back(x.second);
  }
  sort(v.begin(), v.end());
  if (is_bus()) {
    cout << "bus topology\n";
  } else if (is_ring()) {
    cout << "ring topology\n";
  } else if (is_star()) {
    cout << "star topology\n";
  } else {
    cout << "unknown topology\n";
  }
  return 0;
}
