#include <bits/stdc++.h>
using namespace std;
int arr[1000010];
int main() {
  memset(arr, 0, sizeof(arr));
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    arr[a]++;
    arr[b]++;
  }
  int satu = 0;
  int dua = 0;
  int banyak = 0;
  for (int i = 1; i <= n; i++) {
    if (arr[i] == 1) {
      satu++;
    } else if (arr[i] == 2) {
      dua++;
    } else if (arr[i] == n - 1) {
      banyak++;
    }
  }
  if (satu == 2 && dua == n - 2 && banyak == 0) {
    cout << "bus topology" << endl;
  } else if (dua == n && satu == 0 && banyak == 0) {
    cout << "ring topology" << endl;
  } else if (banyak == 1 && satu == n - 1 && dua == 0) {
    cout << "star topology" << endl;
  } else {
    cout << "unknown topology" << endl;
  }
}
