#include <bits/stdc++.h>
using namespace std;
int n, m, dem[100001], so1, so2;
int main() {
  cin >> n >> m;
  int tam1, tam2;
  for (int i = 1; i <= m; i++) {
    cin >> tam1 >> tam2;
    dem[tam1]++;
    dem[tam2]++;
  };
  for (int i = 1; i <= n; i++) {
    if (dem[i] == 1) so1++;
    if (dem[i] == 2) so2++;
    if (dem[i] == m) {
      cout << "star topology";
      return 0;
    };
  };
  if (so1 == 2 && so2 == n - 2)
    cout << "bus topology";
  else {
    if (so1 == 0 && so2 == n)
      cout << "ring topology";
    else
      cout << "unknown topology";
  };
  return 0;
}
