#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void mini(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void maxi(T &a, T b) {
  if (b > a) a = b;
}
int n, m;
vector<int> E[100005];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    E[u].push_back(v);
    E[v].push_back(u);
  }
  if (n == m) {
    bool ok = 1;
    for (int i = 0; i < n; i++)
      if (E[i].size() != 2) ok = 0;
    if (ok)
      puts("ring topology");
    else
      puts("unknown topology");
  } else if (n != m + 1) {
    puts("unknown topology");
  } else {
    bool ring = 0;
    for (int i = 0; i < n; i++)
      if (E[i].size() == n - 1) ring = 1;
    if (ring) {
      puts("star topology");
      return 0;
    }
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (E[i].size() == 2) cnt++;
    if (cnt == n - 2)
      puts("bus topology");
    else
      puts("unknown topology");
  }
}
