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