#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int sz[maxn], N, M;
int main() {
  scanf("%d%d", &N, &M);
  memset(sz, 0, sizeof(sz));
  vector<int> cnt;
  cnt.resize(N);
  int a, b;
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &a, &b);
    a--, b--;
    cnt[a]++, cnt[b]++;
  }
  sort(cnt.begin(), cnt.end());
  for (int i = 0; i < N; i++) sz[cnt[i]]++;
  if (sz[2] == N)
    printf("ring topology\n");
  else if (sz[1] == 2 && sz[2] == N - 2)
    printf("bus topology\n");
  else if (sz[1] == N - 1 && sz[N - 1] == 1)
    printf("star topology\n");
  else
    printf("unknown topology\n");
}
