#include <bits/stdc++.h>
using namespace std;
int n, m, degree[100010];
int ring() {
  int i;
  for (i = 1; i <= n; i++)
    if (degree[i] != 2) return 0;
  return 1;
}
int star() {
  int i, cnt;
  cnt = 0;
  for (i = 1; i <= n; i++)
    if (degree[i] == n - 1)
      cnt++;
    else if (degree[i] != 1)
      return 0;
  if (cnt == 1) return 1;
  return 0;
}
int bus() {
  int i, cnt;
  cnt = 0;
  for (i = 1; i <= n; i++)
    if (degree[i] == 1)
      cnt++;
    else if (degree[i] != 2)
      return 0;
  if (cnt == 2) return 1;
  return 0;
}
int main(void) {
  int i, a, b;
  while (scanf("%d %d", &n, &m) != EOF) {
    for (i = 1; i <= n; i++) degree[i] = 0;
    for (i = 0; i < m; i++) {
      scanf("%d %d", &a, &b);
      degree[a]++;
      degree[b]++;
    }
    if (ring())
      printf("ring topology\n");
    else if (bus())
      printf("bus topology\n");
    else if (star())
      printf("star topology\n");
    else
      printf("unknown topology\n");
  }
  return 0;
}
