#include <bits/stdc++.h>
using namespace std;
int MAX = 1000000;
int MIN = -1000000;
int INF = 1000000000;
int x4[4] = {0, 1, 0, -1};
int y4[4] = {1, 0, -1, 0};
int x8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int y8[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int i, j, k;
int main() {
  int arr[100100], n, m, x, y;
  memset((arr), (0), sizeof(arr));
  ;
  cin >> n >> m;
  for (i = (0); i < (m); i++) {
    cin >> x >> y;
    arr[x]++;
    arr[y]++;
  }
  int single = 0;
  int dua = 0;
  int lebih = 0;
  for (i = 0; i < 100010; i++) {
    if (arr[i] == 1) single++;
    if (arr[i] == 2) dua++;
    if (arr[i] > 2) lebih++;
  }
  if (single == 2 && lebih == 0) {
    cout << "bus topology" << endl;
    {
      fflush(stdin);
      getchar();
    };
    return 0;
  }
  if (dua == n) {
    cout << "ring topology" << endl;
    {
      fflush(stdin);
      getchar();
    };
    return 0;
  }
  if (single == (n - 1) && dua == 0) {
    cout << "star topology" << endl;
    {
      fflush(stdin);
      getchar();
    };
    return 0;
  }
  cout << "unknown topology" << endl;
  {
    fflush(stdin);
    getchar();
  };
  return 0;
}
