#include <bits/stdc++.h>
using namespace std;
int deg[110000];
int main() {
  int n, e;
  while (cin >> n >> e) {
    memset(deg, false, sizeof(deg));
    while (e--) {
      int a, b;
      cin >> a >> b;
      deg[a - 1]++;
      deg[b - 1]++;
    }
    int type = -1;
    sort(deg, deg + n);
    int i;
    for (i = 0; i < n; i++) {
      if (i < 2) {
        if (deg[i] != 1) break;
      } else {
        if (deg[i] != 2) break;
      }
    }
    if (i == n) type = 0;
    for (i = 0; i < n; i++) {
      if (deg[i] != 2) break;
    }
    if (i == n) type = 1;
    for (i = 0; i < n; i++) {
      if (i != n - 1) {
        if (deg[i] != 1) break;
      } else {
        if (deg[i] != (n - 1)) break;
      }
    }
    if (i == n) type = 2;
    if (type == -1)
      cout << "unknown";
    else if (type == 0)
      cout << "bus";
    else if (type == 1)
      cout << "ring";
    else if (type == 2)
      cout << "star";
    cout << " topology" << endl;
  }
  return 0;
}
