#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> deg(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    deg[a]++;
    deg[b]++;
  }
  int maxi = INT_MIN, mini = INT_MAX;
  for (int i = 0; i < n + 1; i++) {
    if (i) {
      maxi = max(maxi, deg[i]);
      mini = min(mini, deg[i]);
    }
  }
  int count_min = 0;
  for (int i = 0; i < n + 1; i++) {
    if (i) {
      if (deg[i] == mini) count_min++;
    }
  }
  if (maxi == mini && mini == 2) {
    cout << "ring topology";
  } else if (count_min == 2 && maxi == 2) {
    cout << "bus topology";
  } else if (maxi == n - 1 && count_min == n - 1)
    cout << "star topology";
  else
    cout << "unknown topology";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
