#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200005;
const double eps = 1e-7;
const double DINF = 1e100;
const int INF = 1000000006;
const long long LINF = 1000000000000000005ll;
int n, m;
int d[MaxN];
int cnt[MaxN];
int fa[MaxN];
bool vis[MaxN];
int get(int x) {
  if (x == fa[x]) return x;
  return fa[x] = get(fa[x]);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 0; i < m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    d[x]++;
    d[y]++;
    fa[get(x)] = get(y);
  }
  for (int i = 1; i <= n; ++i) ++cnt[d[i]];
  for (int i = 1; i <= n; ++i) vis[get(i)] = 1;
  int t = 0;
  for (int i = 1; i <= n; ++i)
    if (vis[i]) ++t;
  if (t == 2) {
    puts("unknown topology");
    return 0;
  }
  if (cnt[2] == n) {
    puts("ring topology");
  } else if (cnt[1] == n - 1 && cnt[n - 1] == 1) {
    puts("star topology");
  } else if (cnt[1] == 2 && cnt[2] == n - 2) {
    puts("bus topology");
  } else
    puts("unknown topology");
  return 0;
}
