#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, max = 1, count = 1;
vector<vector<int>> v;
vector<int> degree;
void maxDegree() {
  int c = 2;
  int starTopology = n - 1;
  for (int i = 1; i <= n; i++) {
    if (degree[i] == 2) {
    } else if (degree[i] == 1) {
      --c;
    } else if (m == n - 1 && degree[i] == starTopology) {
      cout << "star topology \n";
      return;
    } else {
      cout << "unknown topology\n";
      return;
    }
  }
  (c == 0) ? cout << "bus topology\n" : cout << "ring topology\n";
  return;
}
int main() {
  cin >> n >> m;
  degree.resize(n + 1);
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    degree[a]++;
    degree[b]++;
  }
  maxDegree();
  return 0;
}
