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