#include <bits/stdc++.h>
int main() {
  int n, m, i, j, St[100005], x, y;
  bool t = true;
  scanf("%d%d", &n, &m);
  for (i = 0; i < 100005; i++) St[i] = 0;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    St[x]++;
    St[y]++;
  }
  if (m != n && m != n - 1) {
    printf("unknown topology");
    return 0;
  }
  for (i = 1; i <= n; i++) {
    if (St[i] != 2) t = false;
  }
  if (t) {
    printf("ring topology");
    return 0;
  }
  if (m != n - 1) {
    printf("unknown topology");
    return 0;
  }
  for (i = 1; i <= n; i++)
    if (St[i] == n - 1) t = true;
  if (t) {
    printf("star topology");
    return 0;
  }
  x = 0;
  t = true;
  for (i = 1; i <= n; i++) {
    if (St[i] != 1 && St[i] != 2) {
      printf("unknown topology");
      return 0;
    }
    if (St[i] == 1) x++;
  }
  if (x == 2 && t) {
    printf("bus topology");
    return 0;
  }
  printf("unknown topology");
  return 0;
}
