#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
using namespace std;
int N, M;
int p[MAXN];
int main() {
  scanf("%d %d", &N, &M);
  for (int c = 0; c < M; c++) {
    int a, b;
    scanf("%d %d", &a, &b);
    p[a]++, p[b]++;
  }
  for (int c = 1; c <= N; c++)
    if (p[c] != 2) goto xxx;
  printf("ring topology\n");
  return 0;
xxx:
  int cnt = 0;
  for (int c = 1; c <= N; c++) {
    if (p[c] > 2) goto yyy;
    if (p[c] == 1) cnt++;
  }
  if (cnt == 2) {
    printf("bus topology\n");
    return 0;
  }
yyy:
  cnt = 0;
  for (int c = 1; c <= N; c++)
    if (p[c] > 1) cnt++;
  if (cnt == 1) {
    printf("star topology\n");
    return 0;
  }
  printf("unknown topology\n");
  return 0;
}
