#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:30000000")
using namespace std;
const double EPS = 1E-8;
const int INF = (int)1E+9;
const int MAXN = 100000;
int n;
vector<int> V[MAXN];
bool check_star(const int& startV) {
  for (int i = 0; i < (int)(n); ++i)
    if (i != startV) {
      if (V[i].size() != 1 || V[i][0] != startV) return false;
    } else {
      set<int> S(V[startV].begin(), V[startV].end());
      if (S.size() != n - 1) return false;
    }
  return true;
}
bool check_bus_ring(bool ring) {
  map<int, set<int> > M;
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(V[i].size()); ++j) M[i].insert(V[i][j]);
  int count1 = 0, count2 = 0;
  for (int i = 0; i < (int)(n); ++i)
    if (M[i].size() == 1)
      count1++;
    else if (M[i].size() == 2)
      count2++;
    else
      return false;
  if (ring)
    return count2 == n;
  else
    return (count1 == 2 && count2 == n - 2);
}
int main() {
  int m;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); ++i) {
    int x, y;
    cin >> x >> y;
    V[x - 1].push_back(y - 1);
    V[y - 1].push_back(x - 1);
  }
  if (check_star(V[0][0]) || check_star(0))
    cout << "star topology\n";
  else if (check_bus_ring(false))
    cout << "bus topology\n";
  else if (check_bus_ring(true))
    cout << "ring topology\n";
  else
    cout << "unknown topology\n";
}
