#include <bits/stdc++.h>
struct st {
  int in, out;
} x[100009];
int main() {
  int i, j, k, kase, t, n, m, u, v, indeg, outdeg, in0, out0, in1, out1, in2,
      out2;
  scanf("%d%d", &n, &m);
  indeg = outdeg = 0;
  memset(x, 0, sizeof(x));
  for (i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    x[u].out++;
    x[v].in++;
    x[v].out++;
    x[u].in++;
  }
  in0 = out0 = in1 = out1 = in2 = out2 = 0;
  for (i = 1; i <= n; i++) {
    if (x[i].in == 0)
      in0++;
    else if (x[i].in == 1)
      in1++;
    else if (x[i].in == 2)
      in2++;
    if (x[i].out == 0)
      out0++;
    else if (x[i].out == 1)
      out1++;
    else if (x[i].out == 2)
      out2++;
  }
  if (in1 == 2 && out1 == 2 && in2 == n - 2 && out2 == n - 2)
    printf("bus topology\n");
  else if (in1 == 0 && out1 == 0 && in2 == n && out2 == n)
    printf("ring topology\n");
  else if (in1 == n - 1 && out1 == n - 1 && in2 == 0 && out2 == 0)
    printf("star topology\n");
  else
    printf("unknown topology\n");
  return 0;
}
