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