#include <bits/stdc++.h>
using namespace std;
int a[101010], n, deg[101010], m;
int mini(int a, int b) {
  if (a < b) return a;
  return b;
}
int maxi(int a, int b) {
  if (a > b) return a;
  return b;
}
int chck1();
int chck2();
int chck3();
int main() {
  int i, j, k, l, test, t = 1;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &k, &l);
    deg[k]++;
    deg[l]++;
  }
  if (chck1()) {
    printf("bus topology\n");
    return 0;
  }
  if (chck2()) {
    printf("ring topology\n");
    return 0;
  }
  if (chck3()) {
    printf("star topology\n");
    return 0;
  }
  printf("unknown topology\n");
  return 0;
}
int chck1() {
  int i, j, k, c1 = 0, c2 = 0;
  for (i = 1; i <= n; i++) {
    if (deg[i] == 1)
      c1++;
    else if (deg[i] == 2)
      c2++;
    else
      return 0;
  }
  if (c1 == 2) return 1;
  return 0;
}
int chck2() {
  int i, j, k, c1 = 0, c2 = 0;
  for (i = 1; i <= n; i++) {
    if (deg[i] != 2) return 0;
  }
  return 1;
}
int chck3() {
  int i, j, k, c1 = 0, c2 = 0;
  for (i = 1; i <= n; i++) {
    if (deg[i] == n - 1)
      c1++;
    else if (deg[i] == 1)
      c2++;
    else
      return 0;
  }
  if (c1 == 1) return 1;
  return 0;
}
