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