#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> v(n);
  for (int i = 0; i < n; i++) v[i] = 0;
  while (m--) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    v[a]++;
    v[b]++;
  }
  sort(v.begin(), v.end());
  if (v[0] == 2 && v[n - 1] == 2)
    cout << "ring topology";
  else if (v[0] == 1 && v[n - 2] == 1 && v[n - 1] == n - 1)
    cout << "star topology";
  else if (v[0] == v[1] && v[1] == 1 && v[2] == v[n - 1] && v[2] == 2)
    cout << "bus topology";
  else
    cout << "unknown topology";
}
