#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
int nextint() {
  int a;
  scanf("%d", &a);
  return a;
}
double nextdouble() {
  double a;
  scanf("%lf", &a);
  return a;
}
bool equal(double a, double b) { return fabs(a - b) < EPS; }
map<int, int> mp;
int n;
bool isBus() { return mp.size() == 2 && mp[1] == 2 && mp[2] == n - 2; }
bool isStar() { return mp.size() == 2 && mp[1] == n - 1 && mp[n - 1] == 1; }
bool isRing() { return mp.size() == 1 && mp[2] == n; }
vector<int> v;
int main() {
  n = nextint();
  int m = nextint();
  v.resize(n);
  while (m--) {
    int a = nextint() - 1;
    int b = nextint() - 1;
    v[a]++;
    v[b]++;
  }
  for (int i = 0; i < n; i++) mp[v[i]]++;
  if (isBus())
    puts("bus topology");
  else if (isStar())
    puts("star topology");
  else if (isRing())
    puts("ring topology");
  else
    puts("unknown topology");
  return 0;
}
