#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const double pi = 3.14159265358979323;
const double eps = 1e-8;
const int Maxn = 101000;
bool vis[Maxn];
vector<int> vec[Maxn];
int deg[Maxn], n, m;
int cnt;
void dfs(int u) {
  vis[u] = true;
  cnt++;
  for (int i = 0; i < vec[u].size(); i++) {
    int v = vec[u][i];
    if (!vis[v]) dfs(v);
  }
}
void solve() {
  cnt = 0;
  memset(vis, false, sizeof(vis));
  dfs(1);
  if (cnt != n) {
    cout << "unknown topology" << endl;
    return;
  }
  int cnt1 = 0, cnt2 = 0;
  bool flag = false;
  for (int i = 1; i <= n; i++) {
    cnt1 += (deg[i] == 1);
    cnt2 += (deg[i] == 2);
    if (deg[i] == n - 1) flag = true;
  }
  if (cnt1 == 2 && cnt2 == n - 2) {
    cout << "bus topology" << endl;
    return;
  }
  if (cnt2 == n) {
    cout << "ring topology" << endl;
    return;
  }
  if (cnt1 == n - 1 && flag) {
    cout << "star topology" << endl;
    return;
  }
  cout << "unknown topology" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    vec[i].clear();
    deg[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    deg[a]++;
    deg[b]++;
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  solve();
  return 0;
}
