#include <bits/stdc++.h>
using namespace std;
int A[100005], B[100005], deg[100005];
int main() {
  int N, M, type = -1;
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; ++i) {
    scanf("%d%d", &A[i], &B[i]);
    ++deg[A[i]];
    ++deg[B[i]];
  }
  int numones = 0, numtwos = 0;
  for (int i = 1; i <= N; ++i) {
    numones += (deg[i] == 1);
    numtwos += (deg[i] == 2);
  }
  if (M == N - 1) {
    if (numones == 2 && numtwos == N - 2)
      type = 0;
    else if (numones == N - 1)
      type = 2;
  } else if (M == N) {
    if (numtwos == N) type = 1;
  }
  if (type == -1)
    printf("unknown");
  else if (type == 0)
    printf("bus");
  else if (type == 1)
    printf("ring");
  else
    printf("star");
  printf(" topology\n");
}
