#include <bits/stdc++.h>
using namespace std;
const int MAX = INT_MAX;
int cnt[100050];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    cnt[x]++;
    cnt[y]++;
  }
  int k1 = 0, k2 = 0, k3 = 0;
  for (int i = 0; i < n; i++) {
    if (cnt[i] == 1) k1++;
    if (cnt[i] == 2) k2++;
    if (cnt[i] == m) k3++;
  }
  if (k1 == 2 && k2 == (n - 2))
    cout << "bus topology";
  else if (k1 == 0 && k2 == n)
    cout << "ring topology";
  else if (k1 == (n - 1) && k3 == 1)
    cout << "star topology";
  else
    cout << "unknown topology";
  return 0;
}
