#include <bits/stdc++.h>
using namespace std;
long long dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
long long dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
const long double pi = 3.141592653589;
const long long mod = 1000000007;
const long long maxn = 1e5 + 5;
template <typename T>
void printv(const vector<T>& v) {
  for (auto i : v) cout << i << ' ';
  cout << '\n';
}
template <typename T>
void printv(const vector<pair<T, T>>& v) {
  for (auto p : v) cout << "(" << p.first << "," << p.second << "),";
  cout << '\n';
}
long long n, m;
vector<long long> g[maxn];
vector<bool> vis(maxn, false);
bool bus() {
  long long o = 0, t = 0, otr = 0;
  for (long long i = 1; i <= n; i++) {
    if (g[i].size() == 1)
      o++;
    else if (g[i].size() == 2)
      t++;
    else
      otr++;
  }
  if (t == n - 2 && o == 2 && otr == 0) return true;
  return false;
}
bool ring() {
  long long o = 0, t = 0, otr = 0;
  for (long long i = 1; i <= n; i++) {
    if (g[i].size() == 1)
      o++;
    else if (g[i].size() == 2)
      t++;
    else
      otr++;
  }
  if (t == n) return true;
  return false;
}
bool star() {
  long long o = 0, t = 0, otr = 0;
  for (long long i = 1; i <= n; i++) {
    if (g[i].size() == 1)
      o++;
    else if (g[i].size() == 2)
      t++;
    else
      otr++;
  }
  if (o == n - 1) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (bus())
    cout << "bus topology" << '\n';
  else if (ring())
    cout << "ring topology" << '\n';
  else if (star())
    cout << "star topology" << '\n';
  else
    cout << "unknown topology" << '\n';
  return 0;
}
