#include <bits/stdc++.h>
using namespace std;
int inputN, inputM;
string result = "unknown topology";
vector<vector<int> > ver(0);
bool isBus();
bool isRing();
bool isStar();
int main() {
  int ii;
  int inputX, inputY;
  cin >> inputN >> inputM;
  ver.resize(inputN + 1);
  for (ii = 0; ii < inputM; ii++) {
    cin >> inputX >> inputY;
    ver[inputX].push_back(inputY);
    ver[inputY].push_back(inputX);
  }
  if ((inputM == (inputN - 1)) && isBus())
    result = "bus topology";
  else if ((inputN == inputM) && isRing())
    result = "ring topology";
  else if ((inputM == (inputN - 1)) && isStar())
    result = "star topology";
  cout << result << endl;
  return 0;
}
bool isBus() {
  int ii;
  int oneEdge = 0;
  for (ii = 1; (ii <= inputN) && (oneEdge < 3); ii++) {
    if (ver[ii].size() > 2)
      return 0;
    else if (ver[ii].size() == 1)
      oneEdge++;
  }
  if (oneEdge != 2) return 0;
  return 1;
}
bool isRing() {
  int ii;
  bool haveStart = 0;
  for (ii = 1; ii <= inputN; ii++) {
    if ((ver[ii].size() != 2) && haveStart)
      return 0;
    else
      haveStart = 1;
  }
  return 1;
}
bool isStar() {
  int ii;
  bool haveMain = 0;
  for (ii = 1; ii <= inputN; ii++) {
    if ((ver[ii].size() == (inputN - 1)) && !haveMain)
      haveMain = 1;
    else if (ver[ii].size() != 1)
      return 0;
  }
  return 1;
}
