#include <bits/stdc++.h>
using namespace std;
int n, m;
map<int, vector<int> > adj;
bool vis[100005] = {0};
int cnt = 0;
void dfs(int s) {
  cnt++;
  int ch;
  for (int i = 0; i < adj[s].size(); i++) {
    ch = adj[s][i];
    if (vis[ch] == false) {
      vis[ch] = true;
      dfs(ch);
    }
  }
}
int main() {
  int t1, t2;
  int mx = 0, mn = 10000000, tot = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> t1 >> t2;
    adj[t1].push_back(t2);
    adj[t2].push_back(t1);
  }
  for (int i = 1; i <= n; i++) {
    int size = adj[i].size();
    tot += size;
    mx = max(mx, size);
    mn = min(mn, size);
  }
  if (mx == n - 1 && tot == 2 * (n - 1)) {
    cout << "star topology\n";
    return 0;
  }
  vis[1] = true;
  dfs(1);
  if (cnt == n) {
    if (mx == mn && mx == 2)
      cout << "ring topology\n";
    else if (mx == 2 && mn == 1) {
      cout << "bus topology\n";
    } else
      cout << "unknown topology\n";
  } else {
    cout << "unknown topology\n";
  }
}
