#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005, maxm = 200005;
int degree[maxn];
int cnt1, cnt2, cnt3, cnt4, n, m;
void init() {
  scanf("%d%d", &n, &m);
  int i, x, y;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    ++degree[x];
    ++degree[y];
  }
}
void work() {
  int i;
  for (i = 1; i <= n; i++) {
    if (degree[i] == 1) ++cnt1;
    if (degree[i] == 2) ++cnt2;
    if (degree[i] > 2) ++cnt3;
    if (degree[i] == 0) ++cnt4;
  }
  if (cnt2 == n - 2 && cnt1 == 2) {
    printf("bus topology\n");
    return;
  }
  if (cnt2 == n) {
    printf("ring topology\n");
    return;
  }
  if (cnt3 == 1 && cnt1 == n - 1) {
    printf("star topology\n");
    return;
  }
  printf("unknown topology\n");
}
int main(void) {
  init();
  work();
  return 0;
}
