#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, a, b, k = 0, kk = 0;
  scanf("%d %d", &n, &m);
  if (n == m + 1) {
    vector<int> c(n + 1, 0);
    for (i = 0; i < m; i++) {
      scanf("%d %d", &a, &b);
      c[a]++;
      c[b]++;
    }
    for (i = 1; i <= n && (c[i] == 1 || c[i] == m || c[i] == 2); i++)
      if (c[i] == 1)
        k++;
      else if (c[i] == m)
        kk++;
    if (k == n - 1 && kk == 1)
      cout << "star topology" << endl;
    else if (k == 2)
      cout << "bus topology" << endl;
    else
      cout << "unknown topology" << endl;
  } else if (n == m) {
    vector<int> c(n + 1, 0);
    for (i = 0; i < m; i++) {
      scanf("%d %d", &a, &b);
      c[a]++;
      c[b]++;
    }
    for (i = 1; i <= n && k == 0; i++)
      if (c[i] == 1) k++;
    if (k == 0)
      cout << "ring topology" << endl;
    else
      cout << "unknown topology" << endl;
  } else
    cout << "unknown topology" << endl;
  return 0;
}
