#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
struct Edge {
  int from, to, nxt;
} edge[MAX * 2];
int tot, head[MAX], in[MAX], out[MAX];
void add(int x, int y) {
  edge[++tot].nxt = head[x];
  head[x] = tot;
  edge[tot].from = x;
  edge[tot].to = y;
  in[y]++;
  out[x]++;
}
int n, m;
bool flag1 = 0, flag2 = 0, flag3 = 0;
void inp() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
}
void judge() {
  int IN, OUT, Max;
  IN = OUT = Max = 0;
  for (int i = 1; i <= n; i++) {
    IN += in[i];
    OUT += out[i];
    Max = max(Max, in[i]);
  }
  if (IN == n * 2 && Max == 2)
    flag2 = 1;
  else if (IN == m * 2 && Max == m)
    flag3 = 1;
  else if (Max == 2 && IN == 2 * n - 2)
    flag1 = 1;
}
int main() {
  inp();
  judge();
  if (flag1)
    printf("bus topology");
  else if (flag2)
    printf("ring topology");
  else if (flag3)
    printf("star topology");
  else
    printf("unknown topology");
  return 0;
}
