#include <bits/stdc++.h>
using namespace std;
bool isSquare(int x) {
  int y = sqrt(x);
  return y * y == x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i, t = 1;
  while (t--) {
    long long int c = 0, d = 0, k, mx = 0, mn;
    long long int m, x, y, j;
    cin >> n >> m;
    vector<long long int> ar(n + 1, 0);
    long long int a, b;
    for (i = 0; i < m; i++) {
      cin >> a >> b;
      ar[a]++;
      ar[b]++;
    }
    sort((ar).begin(), (ar).end());
    if (ar[n] == n - 1 && ar[n - 1] == 1)
      cout << "star topology\n";
    else if (ar[1] == 1 && ar[2] == 1 && ar[3] == 2 && ar[n] == 2)
      cout << "bus topology\n";
    else if (ar[i] == ar[n] && ar[1] == 2)
      cout << "ring topology\n";
    else
      cout << "unknown topology\n";
  }
  return 0;
}
