#include <bits/stdc++.h>
using namespace std;
int deg[200000];
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int q, w;
    cin >> q >> w;
    q--;
    w--;
    deg[q]++;
    deg[w]++;
  }
  bool circle = true;
  for (int i = 0; i < n; i++)
    if (deg[i] != 2) circle = false;
  vector<int> arr(3, 0);
  for (int i = 0; i < n; i++)
    if (deg[i] < 3) arr[deg[i]]++;
  bool bus = false;
  if (arr[1] == 2 && arr[2] + arr[1] == n) bus = true;
  bool star = false;
  for (int i = 0; i < n; i++)
    if (deg[i] == arr[1] && arr[1] == n - 1) star = true;
  if (circle)
    cout << "ring topology";
  else if (bus)
    cout << "bus topology";
  else if (star)
    cout << "star topology";
  else
    cout << "unknown topology";
  return 0;
}
