#include <bits/stdc++.h>
int weight[100000];
void judge(int z[], int n) {
  int a = 0, b = 0, c = 0;
  for (int i = 1; i <= n; i++) {
    if (z[i] == 1)
      a++;
    else if (z[i] == 2)
      b++;
    else if (z[i] == n - 1)
      c++;
  }
  if (a == 2 && b == n - 2)
    printf("bus topology");
  else if (a == n - 1 && c == 1)
    printf("star topology");
  else if (b == n)
    printf("ring topology");
  else
    printf("unknown topology");
}
int main() {
  int n, m, a, b;
  memset(weight, 0, 100000);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    weight[a]++;
    weight[b]++;
  }
  judge(weight, n);
}
