#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;
  if (m > n) {
    cout << "unknown topology\n";
    return 0;
  }
  vector<vector<int>> graph(n + 1);
  unordered_map<int, int> hash;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    graph[u].emplace_back(v);
    graph[v].emplace_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (graph[i].size() == 0) {
      cout << "unknown topology\n";
      return 0;
    }
    hash[graph[i].size()]++;
  }
  if (hash[2] == n)
    cout << "ring topology\n";
  else if (hash[2] == (n - 2) and hash[1] == 2)
    cout << "bus topology\n";
  else if (hash[n - 1] == 1 and hash[1] == n - 1)
    cout << "star topology\n";
  else
    cout << "unknown topology\n";
  return 0;
}
