#include <bits/stdc++.h>
using namespace std;
queue<unsigned long long int> q[100005];
int main() {
  queue<long long> qq;
  long ar[100005], n, m, i, a, b, p = 0;
  while (cin >> n >> m) {
    long long count = 0, count1 = 0, v = 0, aa[100005] = {0}, j = 0;
    for (i = 0; i < m; i++) {
      cin >> a >> b;
      q[a].push(b);
      q[b].push(a);
    }
    for (i = 1; i <= n; i++) {
      queue<long> qqq;
      qqq.empty();
      long x;
      qq.push(i);
      x = qq.front();
      qq.pop();
      while (q[x].size() != 0) {
        long x1;
        x1 = q[x].front();
        q[x].pop();
        qqq.push(x1);
      }
      ar[p++] = qqq.size();
      aa[x] = ar[p - 1];
    }
    for (j = 1; j <= n; j++) {
      if (aa[j] == 1) count++;
      if (aa[j] == 2) count1++;
      if (aa[j] == (n - 1)) v++;
    }
    if (count == (n - 1) && v == 1)
      cout << "star topology\n";
    else if (count1 == n)
      cout << "ring topology\n";
    else if (count == 2 && count1 == (n - 2))
      cout << "bus topology\n";
    else
      cout << "unknown topology\n";
  }
  return 0;
}
