#include <bits/stdc++.h>
using namespace std;
int n, m, grau[100100], a, b;
int cnt(int a) {
  int ret = 0;
  for (int i = 0; i < n; ++i)
    if (grau[i] == a) ret++;
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) grau[i] = 0;
  for (int i = 0; i < m; ++i)
    scanf("%d%d", &a, &b), grau[a - 1]++, grau[b - 1]++;
  bool bus = 0, ring = 0, star = 0;
  if (cnt(1) == 2 && cnt(2) == (n - 2)) bus = 1;
  if (cnt(2) == n) ring = 1;
  if (cnt(1) == (n - 1) && cnt(n - 1) == 1) star = 1;
  int qts = bus + ring + star;
  if (qts != 1)
    puts("unknown topology");
  else if (bus)
    puts("bus topology");
  else if (ring)
    puts("ring topology");
  else if (star)
    puts("star topology");
  return 0;
}
