#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, one = 0, two = 0, all = 0, other = 0;
  cin >> n >> m;
  vector<int> adj[100005];
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) {
    if (adj[i].empty()) {
      cout << "unknown topology";
      return 0;
    } else if (adj[i].size() == 1)
      ++one;
    else if (adj[i].size() == 2)
      ++two;
    else if (adj[i].size() == n - 1)
      ++all;
    else
      ++other;
  }
  if (one == 2 && all == 0 && other == 0 && two == n - 2)
    cout << "bus topology";
  else if (one == n - 1 && two == 0 && other == 0 && all == 1)
    cout << "star topology";
  else if (two == n && one == 0 && other == 0 && all == 0)
    cout << "ring topology";
  else
    cout << "unknown topology";
}
