#include <bits/stdc++.h>
using namespace std;
int Node[100001];
int main() {
  int N, Edge, x, y, Bus = 1, Ring = 1, Star = 1, Count1 = 0, Haven1 = 0;
  scanf("%d %d", &N, &Edge);
  for (int i = 0; i < Edge; i++) {
    scanf("%d %d", &x, &y);
    Node[x]++;
    Node[y]++;
  }
  for (int i = 1; i <= N; i++) {
    if (Node[i] != 2) Ring = 0;
    if (Node[i] == 1)
      Count1++;
    else if (Node[i] > 2)
      Bus = 0;
    if (Node[i] == N - 1) Haven1 = 1;
  }
  if (Count1 == 2 && Bus)
    Bus = 1;
  else
    Bus = 0;
  if (Haven1 && Count1 == N - 1)
    Star = 1;
  else
    Star = 0;
  if (Bus)
    printf("bus topology");
  else if (Ring)
    printf("ring topology");
  else if (Star)
    printf("star topology");
  else
    printf("unknown topology");
  return 0;
}
