#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long q, w;
long long sum = 0;
int md(int n) {
  if (n > 0)
    return n;
  else
    return -n;
}
string str, str2;
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> v(n + 1, 0);
  for (int i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    v[a - 1]++;
    v[b - 1]++;
  }
  if (m != n && m != n - 1) {
    cout << "unknown topology\n";
    return;
  }
  int one = 0, two = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] == 1) one++;
    if (v[i] == 2) two++;
    if (v[i] == n - 1) w++;
  }
  if (one == 2 && two == n - 2) {
    cout << "bus topology";
    return;
  }
  if (one == n - 1 && w == 1) {
    cout << "star topology";
    return;
  }
  if (one == 0 && two == n) {
    cout << "ring topology";
    return;
  }
  cout << "unknown topology";
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
