#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int n, m;
int deg[200000];
bool isBus() {
  int cnt = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (deg[i] > 2) return false;
    if (deg[i] == 1) cnt++;
  }
  return cnt == 2;
}
bool isRing() {
  for (int i = 0; i < (int)(n); i++)
    if (deg[i] != 2) return false;
  return true;
}
bool isStar() {
  bool have = false;
  for (int i = 0; i < (int)(n); i++) {
    if (deg[i] == 1) continue;
    if (deg[i] != n - 1 || have) return false;
    have = true;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int u, v;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    cin >> u >> v;
    u--;
    v--;
    deg[u]++;
    deg[v]++;
  }
  if (isBus())
    cout << "bus topology" << endl;
  else if (isRing())
    cout << "ring topology" << endl;
  else if (isStar())
    cout << "star topology" << endl;
  else
    cout << "unknown topology" << endl;
  return 0;
}
