#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, x, y;
  scanf("%d%d", &n, &m);
  vector<int> v(n + 1, 0), c(n + 1, 0);
  for (i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    v[x]++;
    v[y]++;
  }
  for (i = 1; i <= n; i++) c[v[i]]++;
  if ((c[1] == 2) && (c[2] == n - 2))
    printf("bus topology");
  else if (c[2] == n)
    printf("ring topology");
  else if ((c[1] == n - 1) && (c[n - 1] == 1))
    printf("star topology");
  else
    printf("unknown topology");
  return 0;
}
