#include <bits/stdc++.h>
using namespace std;
vector<long long> g[100000 + 5];
long long cnt[100000 + 5] = {};
void solve() {
  long long n, m;
  cin >> n >> m;
  if (m > n)
    cout << "unknown topology"
         << "\n";
  else {
    for (long long i = 0; i < m; i++) {
      long long x, y;
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    for (long long i = 1; i <= n; i++) {
      long long s = g[i].size();
      cnt[s]++;
    }
    if (cnt[2] == n)
      cout << "ring topology"
           << "\n";
    else if (cnt[1] == 2 && cnt[2] == n - 2)
      cout << "bus topology"
           << "\n";
    else if (cnt[1] == n - 1 && cnt[n - 1] == 1)
      cout << "star topology"
           << "\n";
    else
      cout << "unknown topology"
           << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (long long i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
