#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  for (long long t_ = 1; t_ <= T; ++t_) {
    long long n, m;
    cin >> n >> m;
    bool flag = true;
    long long deg[n + 1];
    memset(deg, 0, sizeof(deg));
    for (long long i = 0; i < m; ++i) {
      long long x, y;
      cin >> x >> y;
      deg[x]++;
      deg[y]++;
    }
    long long deg1 = 0, deg2 = 0;
    for (long long i = 1; i <= n; i++) {
      if (deg[i] == 1)
        deg1++;
      else if (deg[i] == 2)
        deg2++;
    }
    if (deg1 == 2 and deg2 == n - 2)
      cout << "bus topology";
    else if (deg2 == n)
      cout << "ring topology";
    else if (deg1 == n - 1)
      cout << "star topology";
    else
      cout << "unknown topology";
    cout << '\n';
  }
  return 0;
}
