#include <bits/stdc++.h>
using namespace std;
const int kMaxN = 210000;
vector<int> adj[kMaxN];
int n, m;
int IsStar() {
  if (m != n - 1) return 0;
  for (int(i) = 0; (i) < (n); ++(i))
    if (((int)(adj[i]).size()) != 1 && ((int)(adj[i]).size()) != n - 1)
      return 0;
  return 1;
}
int IsPath() {
  if (m != n - 1) return 0;
  for (int(i) = 0; (i) < (n); ++(i))
    if (((int)(adj[i]).size()) != 1 && ((int)(adj[i]).size()) != 2) return 0;
  return 1;
}
int IsCircle() {
  if (m != n) return 0;
  for (int(i) = 0; (i) < (n); ++(i))
    if (((int)(adj[i]).size()) != 2) return 0;
  return 1;
}
int main() {
  cin >> n >> m;
  for (int(i) = 0; (i) < (m); ++(i)) {
    int x, y;
    scanf("%d%d", &x, &y);
    --x;
    --y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (IsStar()) {
    cout << "star topology" << endl;
  } else if (IsPath()) {
    cout << "bus topology" << endl;
  } else if (IsCircle()) {
    cout << "ring topology" << endl;
  } else {
    cout << "unknown topology" << endl;
  }
}
