#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> v(N + 1);
  for (int i = 1; i <= M; ++i) {
    int x, y;
    cin >> x >> y;
    ++v[x];
    ++v[y];
  }
  sort(v.begin(), v.end());
  if (v[N] == N - 1) {
    for (int i = 1; i < N; ++i) {
      if (v[i] != 1) {
        cout << "unknown topology" << endl;
        return 0;
      }
    }
    cout << "star topology" << endl;
    return 0;
  } else if (v[1] == 1 && v[2] == 1) {
    for (int i = 3; i <= N; ++i) {
      if (v[i] != 2) {
        cout << "unknown topology" << endl;
        return 0;
      }
    }
    cout << "bus topology" << endl;
    return 0;
  } else {
    for (int i = 1; i <= N; ++i) {
      if (v[i] != 2) {
        cout << "unknown topology" << endl;
        return 0;
      }
    }
    cout << "ring topology" << endl;
    return 0;
  }
}
