#include <bits/stdc++.h>
using namespace std;
int main() {
  long m, n;
  while (cin >> m >> n) {
    map<long, long> mp;
    map<long, long>::iterator it;
    long j = 0, c[100001] = {0}, d[100001] = {0}, i1, x, kk = 0, ss = 0, i,
         zz = 0, k, a1, b1;
    for (i1 = 0; i1 < n; i1++) {
      cin >> a1 >> b1;
      {
        mp[a1]++;
        mp[b1]++;
        c[i1] = a1;
        d[i1] = b1;
      }
    }
    sort(c, c + n);
    sort(d, d + n);
    for (it = mp.begin(); it != mp.end(); it++) {
      x = it->second;
      if (x == 1) kk++;
      if (x == 2) ss++;
    }
    if (kk == n)
      printf("star topology\n");
    else if (ss == n)
      printf("ring topology\n");
    else if ((kk == 2) && (ss == m - 2))
      printf("bus topology\n");
    else
      printf("unknown topology\n");
  }
  return 0;
}
