#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt[1000000];
  int n, m, k;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int v1, v2;
    cin >> v1 >> v2;
    ++cnt[v1];
    ++cnt[v2];
  }
  bool ring = true, bus = true, star = true;
  int kol1 = 0;
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] != 2) ring = false;
    if (cnt[i] > 2) {
      ring = false;
      bus = false;
    }
    if (cnt[i] == 1) ring = false;
    if (cnt[i] == 1) ++kol1;
  }
  if (bus && (kol1 != 2)) bus = false;
  if (!ring && !bus && (kol1 != n - 1)) star = false;
  if (bus) {
    cout << "bus topology";
  } else if (ring) {
    cout << "ring topology";
  } else if (star) {
    cout << "star topology";
  } else
    cout << "unknown topology";
}
