//Source: JadArab

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> deg(n+1, 0);

    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        deg[x]++, deg[y]++;
    }

    int d1 = 0, d2 = 0, dn = 0;
    for (int i = 1; i <= n; ++i) {
        if (deg[i] == 1) d1++;
        else if (deg[i] == 2) d2++;
        else if (deg[i] == n-1) dn++;
    }

    if (m == n - 1 && d1 == 2 && d2 == n - 2) cout << "bus topology";
    else if (m == n && d2 == n) cout << "ring topology";
    else if (m == n - 1 && dn == 1 && d1 == n - 1) cout << "star topology";
    else cout << "unknown topology";

    return 0;
}