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