#include <bits/stdc++.h>
using namespace std;
int d[100 * 1000];
int main() {
  int n, m;
  cin.sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    d[u]++, d[v]++;
  }
  bool cir = true;
  int leaf = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] == 1) leaf++;
    if (d[i] != 2) cir = false;
  }
  if (leaf == 2 && m == n - 1)
    cout << "bus topology\n";
  else if (leaf == n - 1)
    cout << "star topology\n";
  else if (cir)
    cout << "ring topology\n";
  else
    cout << "unknown topology\n";
  return 0;
}
