#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, i, j, e, g;
  cin >> n >> j;
  vector<long> v[n + 1];
  for (i = 0; i < j; i++) {
    cin >> e >> g;
    v[e].push_back(g);
    v[g].push_back(e);
  }
  e = 0;
  g = 0;
  j = 0;
  for (i = 1; i <= n; i++) {
    if (v[i].size() == 1)
      e++;
    else if (v[i].size() == 2)
      g++;
    else
      j++;
  }
  if (e == 2 && g == n - 2)
    cout << "bus topology";
  else if (g == n)
    cout << "ring topology";
  else if (e == n - 1 && j == 1)
    cout << "star topology";
  else
    cout << "unknown topology";
  return 0;
}
