#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, x, y, stop1, stop2;
vector<int> g[1000000];
int main() {
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  };
  for (i = 1; i <= n; i++)
    if (g[i].size() == n - 1 && n == m + 1) {
      cout << "star topology";
      return 0;
    };
  for (i = 1; i <= n; i++)
    if (g[i].size() == 2)
      stop2++;
    else
      stop1++;
  if (n == m + 1 && stop1 == 2) {
    cout << "bus topology";
    return 0;
  };
  if (n == m && stop2 == n)
    cout << "ring topology";
  else {
    cout << "unknown topology";
    return 0;
  };
  return 0;
}
