#include <bits/stdc++.h>
using namespace std;
int n, a, b, x, y, i, j, m, D[100001];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> x >> y, D[x]++, D[y]++;
  for (int i = 0; i <= n; i++) {
    if (D[i] == 1) a++;
    if (D[i] == 2) b++;
    if (D[i] == m) cout << "star topology", exit(0);
  }
  if (a == 2 && b == n - 2) cout << "bus topology", exit(0);
  if (b == m && a == 0) cout << "ring topology", exit(0);
  cout << "unknown topology";
  return 0;
}
