#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
const double PI = 3.14159265;
int main() {
  int t;
  t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    for (int i = 0; i < m; i++) {
      int x, y;
      cin >> x >> y;
      v[x - 1]++;
      v[y - 1]++;
    }
    int ones = 0, twos = 0, more = 0;
    for (int i = 0; i < n; i++) {
      if (v[i] == 1)
        ones++;
      else if (v[i] == 2)
        twos++;
      else
        more++;
    }
    if (ones == 2 && more == 0)
      cout << "bus topology";
    else if (more == 1 && twos == 0)
      cout << "star topology";
    else if (twos == n)
      cout << "ring topology";
    else
      cout << "unknown topology";
  }
}
