#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, b, c, ar[500001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> x >> y;
    ar[x]++;
    ar[y]++;
  }
  for (int i = 1; i <= n; ++i) {
    if (ar[i] == 2) {
      b++;
    }
    if (ar[i] == 1) {
      c++;
    }
    if (ar[i] == m) {
      cout << "star topology";
      return 0;
    }
  }
  if (b == n - 2 && c == 2) {
    cout << "bus topology";
    return 0;
  }
  if (b == n) {
    cout << "ring topology";
    return 0;
  }
  cout << "unknown topology";
}
