#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t-- > 0) {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> adj(n + 1);
    for (int i = 0; i < int(m); i++) {
      int x, y;
      cin >> x >> y;
      adj[x].push_back(y);
      adj[y].push_back(x);
    }
    bool is_ring = false, is_bus = false, is_star = false, unknown = false;
    map<int, int> ct;
    for (int i = 1; i <= n; i++) {
      ct[adj[i].size()] += 1;
    }
    if (ct[n - 1] == 1 && ct[1] == n - 1) {
      is_star = true;
    }
    if (is_star) {
      cout << "star topology\n";
    } else {
      if (ct[2] == n - 2 && ct[1] == 2) {
        is_bus = true;
      }
      if (is_bus) {
        cout << "bus topology\n";
      } else {
        if (ct[2] == n) {
          is_ring = true;
        }
        if (is_ring)
          cout << "ring topology\n";
        else
          cout << "unknown topology\n";
      }
    }
  }
}
