#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int N, E;
  cin >> N >> E;
  vector<vector<int>> neighbor(1 + N);
  for (int e = 0; e < E; e++) {
    int u, v;
    cin >> u >> v;
    neighbor[u].push_back(v);
    neighbor[v].push_back(u);
  }
  bool ringChecker = true;
  bool busChecker = true;
  bool starChecker = true;
  int number_of_one_bus = 0;
  int number_of_one_star = 0;
  int number_of_two_bus = 0;
  int number_of_one_ring = 0;
  int number_of_two_ring = 0;
  int number_of_irregular_star = 0;
  for (int n = 1; n <= N; n++) {
    if (neighbor[n].size() == 2) {
      number_of_two_bus++;
      number_of_two_ring++;
    } else if (neighbor[n].size() == 1) {
      number_of_one_bus++;
      number_of_one_star++;
    } else if (neighbor[n].size() == N - 1) {
      number_of_irregular_star++;
    }
  }
  if (number_of_two_ring != N) {
    ringChecker = false;
  }
  if (number_of_one_star != N - 1 || number_of_irregular_star != 1) {
    starChecker = false;
  }
  if (number_of_one_bus < 2 || number_of_one_bus > 2 ||
      number_of_two_bus != N - 2) {
    busChecker = false;
  }
  if (busChecker) {
    cout << "bus topology" << endl;
  } else if (starChecker) {
    cout << "star topology" << endl;
  } else if (ringChecker) {
    cout << "ring topology" << endl;
  } else {
    cout << "unknown topology" << endl;
  }
}
