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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m;
map <string, int>::iterator it;
set <string> v[MAX];
set <string>::iterator set_it;
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        t += "#";

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].insert(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        t.clear();

        for(set_it = v[i].begin(); set_it != v[i].end(); set_it++)
            t += (*set_it);

        if(t.size() == 1 && (t[0] == '#' || t[0] == '/')) continue;
        if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        //t += "#";
        if(t.empty()) continue;

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t.clear();

        FOR(j,0,k-1) t += v[i][j];

        //if(t.size() == 1 && t[0] == '#') continue;
        //if(t.size() == 2 && t == "/#") continue;
        //if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt;

    if(cnt > 0) cout << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s  = "";

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        t = "#";

        while(i < k)
        {
            t += str[i];
            i++;
        }

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t = "";

        FOR(j,0,k-1) t += v[i][j];

        //if(t.size() == 1 && t[0] == '#') continue;
        //if(t.size() == 2 && t == "/#") continue;
        //if(t.size() == 3 && t == "#/#") continue;

        if(m.find(t) == m.end())
            m[t] = sz++;
        ans[m[t]].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        cout << "http://" << a[ ans[i][0] ];

        FOR(j,1,k-1)
            cout << " http://" << a[ ans[i][j] ];
        cout << NL;
    }

    return 0;
}

/*

5
http://abc/
http://abc
http://abc
http://abd
http://abd/

*/


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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        t += "#";

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t.clear();

        FOR(j,0,k-1) t += v[i][j];

        if(t.size() == 1 && t[0] == '#') continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m;
map <string, int>::iterator it;
set <string> v[MAX];
set <string>::iterator set_it;
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        t += "#";

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].insert(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        t.clear();

        for(set_it = v[i].begin(); set_it != v[i].end(); set_it++)
            t += (*set_it);

        if(t.size() == 1 && t[0] == '#') continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


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

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        t += "#";

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t.clear();

        FOR(j,0,k-1) t += v[i][j];

        if(t.size() == 1 && t[0] == '#') continue;
        if(t.size() == 2 && t == "/#") continue;
        if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned, int>dic;
std::string word[maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
	unsigned mask = 0;
	for(int i = 0; i < s.size(); i++) {
		unsigned cur;
		if(s[i] == '#') cur = 63;
		if(s[i] == '.') cur = 27;
		else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
		else cur = s[i] - 'A' + 1;
		mask = mask * 67 + cur;
	}
	std::map<unsigned, int>::iterator it = dic.find(mask);
	if(it == dic.end())  {
		dic.insert(std::make_pair(mask, cnt));
		word[cnt] = s;
		return cnt++;
	}
	else return it->second;
}

int main() {
	scanf("%d", &n);
	m = 0;
	for(int i = 0; i < n; i++) {
		scanf("%s", buf);
		std::string s = std::string(buf);
		s = s.substr(7, s.size() - 7);
		int b = s.find("/");
		if(b != -1)
		    a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
		else
		    a[m++] = std::make_pair(get(s), get("#"));

	}
	std::sort(a, a + m);
	m = std::unique(a, a + m) - a;
	J = 0;
	int q;
	for(int i = 0; i < m; i++) {
		c[q++] = a[i].second;
		if(a[i].first != a[i + 1].first || i == m - 1) {
			unsigned long long mask = 0;
			for(int j = 0; j < q; j++)
				mask = mask * (cnt + 17) + (c[j]);
			ans[J++] = std::make_pair(mask, a[i].first);
			q = 0;
		}
	}
	std::sort(ans, ans + J);
	int tot = 0;
	int pre = -1;
	for(int i = 0; i < J; i++)
	if(i == J - 1 || ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) tot++;
		pre = i;
	}
	printf("%d\n", tot);
	pre = -1;
	for(int i = 0; i < J; i++)
	if(i == J - 1 || ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) {
			for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
			puts("");
		}
		pre = i;
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned, int>dic;
std::string word[maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
    unsigned mask = 0;
    for(int i = 0; i < s.size(); i++) {
        unsigned cur;
        if(s[i] == '#') cur = 63;
        if(s[i] == '.') cur = 27;
        else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
        else cur = s[i] - 'A' + 1;
        mask = mask * 67 + cur;
    }
    std::map<unsigned, int>::iterator it = dic.find(mask);
    if(it == dic.end())  {
        dic.insert(std::make_pair(mask, cnt));
        word[cnt] = s;
        return cnt++;
    }
    else return it->second;
}

int main() {
    scanf("%d", &n);
    m = 0;
    for(int i = 0; i < n; i++) {
        scanf("%s", buf);
        std::string s = std::string(buf);
        s = s.substr(7, s.size() - 7);
        int b = s.find("/");
        if(b != -1)
            a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
        else
            a[m++] = std::make_pair(get(s), get("#"));

    }
    std::sort(a, a + m);
    m = std::unique(a, a + m) - a;
    J = 0;
    int q = 0;
    for(int i = 0; i < m; i++) {
        c[q++] = a[i].second;
        if(i == m - 1 || a[i].first != a[i + 1].first) {
            unsigned long long mask = 0;
            for(int j = 0; j < q; j++)
                mask = mask * (cnt + 17) + (c[j]);
            ans[J++] = std::make_pair(mask, a[i].first);
            q = 0;
        }
    }
    std::sort(ans, ans + J);
    int tot = 0;
    int pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) tot++;
            pre = i;
        }
    printf("%d\n", tot);
    pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) {
                for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
                puts("");
            }
            pre = i;
        }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<std::vector<int>, int >ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<std::string, int>dic;
std::string word[2 * maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
    std::map<std::string, int>::iterator it = dic.find(s);
    if(it == dic.end())  {
        dic.insert(std::make_pair(s, cnt));
        word[cnt] = s;
        return cnt++;
    }
    else return it->second;
}

int vcmp(std::vector<int>&a, std::vector<int>&b) {
	if(a.size() < b.size()) return 0;
	if(a.size() > b.size()) return 1;
	for(int i = 0; i < a.size(); i++)
	if(a[i] < b[i]) return 0;
	else if(a[i] > b[i]) return 1;
	return -1;
}

bool cmp(std::pair< std::vector<int>, int> a, std::pair< std::vector<int>, int> b) {
	int code = vcmp(a.first, b.first);
	if(code == -1) return a.second < b.second;
	else return code;
}

int main() {
    scanf("%d", &n);
    m = 0;
    for(int i = 0; i < n; i++) {
        scanf("%s", buf);
        std::string s = std::string(buf);
        s = s.substr(7, s.size() - 7);
        int b = s.find("/");
        if(b != -1)
            a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
        else
            a[m++] = std::make_pair(get(s), get("#"));

    }
    std::sort(a, a + m);
    m = std::unique(a, a + m) - a;
    J = 0;
    int q = 0;
    for(int i = 0; i < m; i++) {
        c[q++] = a[i].second;
        if(i == m - 1 || a[i].first != a[i + 1].first) {
            for(int j = 0; j < q; j++)
				ans[J].first.push_back(c[j]);
            ans[J].second = a[i].first;
			J++;
            q = 0;
        }
    }
    std::sort(ans, ans + J, cmp);
    int tot = 0;
    int pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) tot++;
            pre = i;
        }
    printf("%d\n", tot);
    pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || -1 != vcmp(ans[i].first, ans[i + 1].first)) {
            if(i - pre > 1) {
                for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
                puts("");
            }
            pre = i;
        }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned long long, int>dic;
std::string word[2 * maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
    unsigned long long mask = 0;
    for(int i = 0; i < s.size(); i++) {
        unsigned long long cur;
        if(s[i] == '#') cur = 63;
        if(s[i] == '.') cur = 27;
        else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
        else cur = s[i] - 'A' + 1;
        mask = mask * 67 + cur;
    }
    std::map<unsigned, int>::iterator it = dic.find(mask);
    if(it == dic.end())  {
        dic.insert(std::make_pair(mask, cnt));
        word[cnt] = s;
        return cnt++;
    }
    else return it->second;
}

int main() {
    scanf("%d", &n);
    m = 0;
    for(int i = 0; i < n; i++) {
        scanf("%s", buf);
        std::string s = std::string(buf);
        s = s.substr(7, s.size() - 7);
        int b = s.find("/");
        if(b != -1)
            a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
        else
            a[m++] = std::make_pair(get(s), get("#"));

    }
    std::sort(a, a + m);
    m = std::unique(a, a + m) - a;
    J = 0;
    int q = 0;
    for(int i = 0; i < m; i++) {
        c[q++] = a[i].second;
        if(i == m - 1 || a[i].first != a[i + 1].first) {
            unsigned long long mask = 0;
            for(int j = 0; j < q; j++)
                mask = mask * (cnt + 17) + (c[j]);
            ans[J++] = std::make_pair(mask, a[i].first);
            q = 0;
        }
    }
    std::sort(ans, ans + J);
    int tot = 0;
    int pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) tot++;
            pre = i;
        }
    printf("%d\n", tot);
    pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) {
                for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
                puts("");
            }
            pre = i;
        }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned, int>dic;
std::string word[maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
	unsigned mask = 0;
	for(int i = 0; i < s.size(); i++) {
		unsigned cur;
		if(s[i] == '.') cur = 27;
		else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
		else cur = s[i] - 'A' + 1;
		mask = mask * 67 + cur;
	}
	std::map<unsigned, int>::iterator it = dic.find(mask);
	if(it == dic.end())  {
		dic.insert(std::make_pair(mask, cnt));
		word[cnt] = s;
		return cnt++;
	}
	else return it->second;
}

int main() {
	scanf("%d", &n);
	m = 0;
	for(int i = 0; i < n; i++) {
		scanf("%s", buf);
		std::string s = std::string(buf);
		s = s.substr(7, s.size() - 7);
		int b = s.find("/");
		if(b == -1) continue;
		a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
	}
	std::sort(a, a + m);
	m = std::unique(a, a + m) - a;
	J = 0;
	int q;
	for(int i = 0; i < m; i++) {
		c[q++] = a[i].second;
		if(a[i].first != a[i + 1].first || i == m - 1) {
			unsigned long long mask = 0;
			for(int j = 0; j < q; j++)
				mask = mask * (cnt + 17) + (c[j]);
			ans[J++] = std::make_pair(mask, a[i].first);
			q = 0;
		}
	}
	std::sort(ans, ans + J);
	int tot = 0;
	int pre = -1;
	for(int i = 0; i < J; i++)
	if(ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) tot++;
		pre = i;
	}
	printf("%d\n", tot);
	pre = -1;
	for(int i = 0; i < J; i++)
	if(ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) {
			for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
			puts("");
		}
		pre = i;
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned, int>dic;
std::string word[maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
	unsigned mask = 0;
	for(int i = 0; i < s.size(); i++) {
		unsigned cur;
		if(s[i] == '.') cur = 27;
		else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
		else cur = s[i] - 'A' + 1;
		mask = mask * 67 + cur;
	}
	std::map<unsigned, int>::iterator it = dic.find(mask);
	if(it == dic.end())  {
		dic.insert(std::make_pair(mask, cnt));
		word[cnt] = s;
		return cnt++;
	}
	else return it->second;
}

int main() {
	scanf("%d", &n);
	m = 0;
	for(int i = 0; i < n; i++) {
		scanf("%s", buf);
		std::string s = std::string(buf);
		s = s.substr(7, s.size() - 7);
		int b = s.find("/");
		if(b == -1) continue;
		a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
	}
	std::sort(a, a + m);
	m = std::unique(a, a + m) - a;
	J = 0;
	int q;
	for(int i = 0; i < m; i++) {
		c[q++] = a[i].second;
		if(a[i].first != a[i + 1].first || i == m - 1) {
			unsigned long long mask = 0;
			for(int j = 0; j < q; j++)
				mask = mask * (cnt + 17) + (c[j]);
			ans[J++] = std::make_pair(mask, a[i].first);
			q = 0;
		}
	}
	std::sort(ans, ans + J);
	int tot = 0;
	int pre = -1;
	for(int i = 0; i < J; i++)
	if(i == J - 1 || ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) tot++;
		pre = i;
	}
	printf("%d\n", tot);
	pre = -1;
	for(int i = 0; i < J; i++)
	if(i == J - 1 || ans[i].first != ans[i + 1].first) {
		if(i - pre > 1) {
			for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
			puts("");
		}
		pre = i;
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

const int maxn = 100010;
char buf[100];
std::pair<unsigned long long, int>ans[maxn];
std::pair<int, int>a[maxn];
int J;
int n;
std::map<unsigned long long, int>dic;
std::string word[2 * maxn];
int c[maxn];
int cnt;
int m;

int get(std::string s) {
    unsigned long long mask = 0;
    for(int i = 0; i < s.size(); i++) {
        unsigned long long cur;
        if(s[i] == '#') cur = 63;
        if(s[i] == '.') cur = 27;
        else if(s[i] >= 'a') cur = 28 + s[i] - 'a';
        else cur = s[i] - 'A' + 1;
        mask = mask * 67 + cur;
    }
    std::map<unsigned long long, int>::iterator it = dic.find(mask);
    if(it == dic.end())  {
        dic.insert(std::make_pair(mask, cnt));
        word[cnt] = s;
        return cnt++;
    }
    else return it->second;
}

int main() {
    scanf("%d", &n);
    m = 0;
    for(int i = 0; i < n; i++) {
        scanf("%s", buf);
        std::string s = std::string(buf);
        s = s.substr(7, s.size() - 7);
        int b = s.find("/");
        if(b != -1)
            a[m++] = std::make_pair(get(s.substr(0, b)), get(s.substr(b + 1, s.size() - b - 1)));
        else
            a[m++] = std::make_pair(get(s), get("#"));

    }
    std::sort(a, a + m);
    m = std::unique(a, a + m) - a;
    J = 0;
    int q = 0;
    for(int i = 0; i < m; i++) {
        c[q++] = a[i].second;
        if(i == m - 1 || a[i].first != a[i + 1].first) {
            unsigned long long mask = 0;
            for(int j = 0; j < q; j++)
                mask = mask * (cnt + 17) + (c[j]);
            ans[J++] = std::make_pair(mask, a[i].first);
            q = 0;
        }
    }
    std::sort(ans, ans + J);
    int tot = 0;
    int pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) tot++;
            pre = i;
        }
    printf("%d\n", tot);
    pre = -1;
    for(int i = 0; i < J; i++)
        if(i == J - 1 || ans[i].first != ans[i + 1].first) {
            if(i - pre > 1) {
                for(int j = pre + 1; j < i + 1; j++) printf("http://%s ", word[ans[j].second].c_str());
                puts("");
            }
            pre = i;
        }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define mp make_pair
#define ll long long
#define pb push_back
#define pii pair<int,int>
map< string,int >paths,hosts;
map<int,string>rev_hosts;
pair< vector< int >,int >v[100011];
vector< string >ans[100011];
map< pii,int >my;
int func(int i,int j)
{
    if(v[i].f.size()!=v[j].f.size())
        return 0;
    for(int k=0;k<min(v[i].f.size(),v[j].f.size());k++)
        if((v[i].f)[k]!=(v[j].f)[k])
            return 0;
    return 1;
}
int main()
{
    int i,j,k,n,sz=1,p=1,idx,an=0,idx1;
    scanf("%d",&n);
    for(i=0; i<n; i++)
    {
        string s,host="",path="";
        cin>>s;
        int len=s.size();
        for(j=7; j<len; j++)
        {
            if(s[j]=='/')
                break;
            host+=s[j];
        }
        for(; j<len; j++)
            path+=s[j];
        if(hosts[host]==0)
        {
            hosts[host]=sz;
            idx=sz;
            sz++;
        }
        else
            idx=hosts[host];
        rev_hosts[idx]=host;
        if(!paths[path])
        {
            paths[path]=p;
            idx1=p;
            p++;
        }
        else
            idx1=paths[path];
        if(!my[mp(idx,idx1)])
        {v[idx].f.pb(idx1);my[mp(idx,idx1)]=1;}
        v[idx].s=idx;
    }
    for(i=1;i<sz;i++)
        sort(v[i].f.begin(),v[i].f.end());
    sort(v+1,v+sz);
//    for(i=1;i<sz;i++)
//    {
//        cout<<v[i].s<<" "<<rev_hosts[v[i].s]<<endl;
//        for(j=0;j<v[i].f.size();j++)
//            cout<<v[i].f[j]<<" ";
//        cout<<endl;
//    }
    for(i=1;i<sz;i++)
    {
        for(j=i+1;j<sz;j++)
        {
            if(!func(i,j))
                break;
        }
        if(j!=i+1)
        {
            for(k=i;k<j;k++)
                ans[an].pb(rev_hosts[v[k].s]);
            an++;
        }
        i=j-1;
    }
    printf("%d\n",an);
    for(i=0;i<an;i++)
    {
        for(j=0;j<ans[i].size();j++)
            cout<<"http://"<<ans[i][j]<<" ";
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
} tmp;

struct group{
	vector<string> names;
} tmpg;

vector<host> v(0);
vector<group> ans(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(pair<string, string> s){
	return s.first;
	/*
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
	*/
}

string path(pair<string, string> s){
	return s.second;
	/*
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
	*/
}

char h[30] = "http://", p[30];

int main(){
	int n; cin >> n;
	pair<string, string> addresses[n + 1];
	for (int i=0;i<n;i++){
		scanf("\nhttp://%[^\n/]", h + 7);
		p[0] = 0;
		if (getchar() == '/') {
			p[0] = '/';
			p[1] = 0;
			scanf("%[^\n]", p + 1);
		}
		addresses[i].first = h;
		addresses[i].second = p;
	}
	sort(addresses, addresses+n);
	tmp.handle = servername(addresses[0]);
	tmp.queries.insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			tmp.queries.clear();
		}
		tmp.queries.insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

/*	for (int i = 0; i < v.size(); i++) {
		cout << "Host: " << v[i].handle << endl;
		for (set<int>::iterator j = v[i].queries2.begin(); j != v[i].queries2.end(); j++)
			cout << "\tPath: " << *j << endl;
	}
*/
	tmpg.names.push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			tmpg.names.push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			tmpg.names.clear();
			tmpg.names.push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<ans[i].names.size();j++){
			cout << ans[i].names[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;

struct host{
	string handle;
	set<string> queries;
};

struct group{
	vector<string> names;
};

vector<host> v(0);

bool cmphost(host x, host y){
	return x.queries < y.queries; // simplification
	//the bug caused runtime error: return true instead of false for x.queries == y.queries
}

bool samehost(host x, host y){
	return x.queries == y.queries; // simplification
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

string servername(pair<string, string> s){ // new function
	return s.first;
}

string path(pair<string, string> s){ // new function
	return s.second;
}

int main(){
	int n; cin >> n;
	pair<string, string> addresses[n]; 	// addresses change to pair
	string temp;						// temp string
	for (int i=0;i<n;i++){
		cin >> temp;
		addresses[i] = make_pair(servername(temp), path(temp));
	}
	sort(addresses, addresses+n);
	host tmp;
	tmp.handle = servername(addresses[0]);			// here use the new function
	(tmp.queries).insert(path(addresses[0]));		// here use the new function
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);		// here use the new function
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			(tmp.queries).clear();
		}
		(tmp.queries).insert(path(addresses[i]));	// here use the new function
	}
	v.push_back(tmp);

	stable_sort(v.begin(),v.end(),cmphost);

	vector<group> ans(0);
	group tmpg;
	(tmpg.names).push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			(tmpg.names).push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			(tmpg.names).clear();
			(tmpg.names).push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);

	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<(ans[i].names).size();j++){
			cout << ((ans[i]).names)[j] << " ";
		}
		cout << endl;
	}
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
} tmp;

struct group{
	vector<string> names;
} tmpg;

vector<host> v(0);
vector<group> ans(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

int main(){
	int n; cin >> n;
	string addresses[n + 1];
	for (int i=0;i<n;i++){
		cin >> addresses[i];
	}
	sort(addresses, addresses+n);
	tmp.handle = servername(addresses[0]);
	tmp.queries.insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			tmp.queries.clear();
		}
		tmp.queries.insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

/*	for (int i = 0; i < v.size(); i++) {
		cout << "Host: " << v[i].handle << endl;
		for (set<int>::iterator j = v[i].queries2.begin(); j != v[i].queries2.end(); j++)
			cout << "\tPath: " << *j << endl;
	}
*/
	tmpg.names.push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			tmpg.names.push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			tmpg.names.clear();
			tmpg.names.push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<ans[i].names.size();j++){
			cout << ans[i].names[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
};

struct group{
	vector<string> names;
};

vector<host> v(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

int main(){
	int n; cin >> n;
	string addresses[n];
	for (int i=0;i<n;i++){
		cin >> addresses[i];
	}
	sort(addresses, addresses+n);
	host tmp;
	tmp.handle = servername(addresses[0]);
	(tmp.queries).insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			(tmp.queries).clear();
		}
		(tmp.queries).insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

	vector<group> ans(0);
	group tmpg;
	(tmpg.names).push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			(tmpg.names).push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			(tmpg.names).clear();
			(tmpg.names).push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<(ans[i].names).size();j++){
			cout << ((ans[i]).names)[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;

struct host{
	string handle;
	set<string> queries;
};

struct group{
	vector<string> names;
};

vector<host> v(0);

bool cmphost(host x, host y){
	return x.queries < y.queries; // simplification
	//the bug caused runtime error: return true instead of false for x.queries == y.queries
}

bool samehost(host x, host y){
	return x.queries == y.queries; // simplification
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

string servername(pair<string, string> s){ // new function
	return s.first;
}

string path(pair<string, string> s){ // new function
	return s.second;
}

int main(){
	ios::sync_with_stdio(false);		// TLE without this line -_-
	int n; cin >> n;
	pair<string, string> addresses[n]; 	// addresses change to pair
	string temp;						// temp string
	for (int i=0;i<n;i++){
		cin >> temp;
		addresses[i] = make_pair(servername(temp), path(temp));
	}
	sort(addresses, addresses+n);
	host tmp;
	tmp.handle = servername(addresses[0]);			// here use the new function
	(tmp.queries).insert(path(addresses[0]));		// here use the new function
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);		// here use the new function
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			(tmp.queries).clear();
		}
		(tmp.queries).insert(path(addresses[i]));	// here use the new function
	}
	v.push_back(tmp);

	stable_sort(v.begin(),v.end(),cmphost);

	vector<group> ans(0);
	group tmpg;
	(tmpg.names).push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			(tmpg.names).push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			(tmpg.names).clear();
			(tmpg.names).push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);

	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<(ans[i].names).size();j++){
			cout << ((ans[i]).names)[j] << " ";
		}
		cout << endl;
	}
}


#include<bits/stdc++.h>

int n, lh = 1, lp = 1, ln = 2, ans;
char h[30] = "http://", p[30];
std::string sh, sp;
std::vector<int> a[100005], g[100005];
std::vector<std::string> mh, mp;
std::map<int, int> mc[100005];
std::map<std::string, int> host, path;
std::map<std::pair<std::string, std::string>, bool> u;

bool cmp(int x, int y) {
	return mp[x] < mp[y];
}

int main() {
	scanf("%d", &n);
	mh.push_back(p);
	mp.push_back(p);
	while (n--) {
		scanf("\nhttp://%[^\n/]", h + 7);
		p[0] = 0;
		if (getchar() == '/') {
			p[0] = '/';
			p[1] = 0;
			scanf("%[^\n]", p + 1);
		}
		sh = h;
		sp = p;
		if (!u[std::make_pair(sh, sp)]) {
			u[std::make_pair(sh, sp)] = true;
			if (!host[sh]) {
				host[sh] = lh++;
				mh.push_back(sh);
			}
			if (!path[sp]) {
				path[sp] = lp++;
				mp.push_back(sp);
			}
			a[host[sh]].push_back(path[sp]);
		}
	}
	for (int i = 1; i < lh; i++) std::sort(a[i].begin(), a[i].end(), cmp);
	for (int i = 1; i < lh; i++) {
		int c = 1;
		for (int j = 0; j < a[i].size(); j++) {
			if (mc[c][a[i][j]]) c = mc[c][a[i][j]];
			else c = mc[c][a[i][j]] = ln++;
		}
		g[c].push_back(i);
	}
	for (int i = 0; i < ln; i++) if (g[i].size() > 1) ans++;
	printf("%d\n", ans);
	for (int i = 0; i < ln; i++) if (g[i].size() > 1) for (int j = 0; j < g[i].size(); j++)
		printf("%s%c", mh[g[i][j]].c_str(), j == g[i].size() - 1 ? '\n' : ' ');
	scanf("\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
} tmp;

struct group{
	vector<string> names;
} tmpg;

vector<host> v(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

int main(){
	int n; cin >> n;
	string addresses[n];
	for (int i=0;i<n;i++){
		cin >> addresses[i];
	}
	sort(addresses, addresses+n);
	tmp.handle = servername(addresses[0]);
	(tmp.queries).insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			(tmp.queries).clear();
		}
		(tmp.queries).insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

	vector<group> ans(0);
	(tmpg.names).push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			(tmpg.names).push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			(tmpg.names).clear();
			(tmpg.names).push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<(ans[i].names).size();j++){
			cout << ((ans[i]).names)[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
} tmp;

struct group{
	vector<string> names;
} tmpg;

vector<host> v(0);
vector<group> ans(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

int main(){
	int n; cin >> n;
	string addresses[n];
	for (int i=0;i<n;i++){
		cin >> addresses[i];
	}
	sort(addresses, addresses+n);
	tmp.handle = servername(addresses[0]);
	tmp.queries.insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			tmp.queries.clear();
		}
		tmp.queries.insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

	tmpg.names.push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			tmpg.names.push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			tmpg.names.clear();
			tmpg.names.push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<ans[i].names.size();j++){
			cout << ans[i].names[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <bits/stdc++.h>

using namespace std;

struct host{
	string handle;
	set<string> queries;
} tmp;

struct group{
	vector<string> names;
} tmpg;

vector<host> v(0);
vector<group> ans(0);

bool cmphost(host x, host y){
	return x.queries < y.queries;
}

bool samehost(host x, host y){
	return x.queries == y.queries;
}

string servername(pair<string, string> s){
	return s.first;
	/*
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
	*/
}

string path(pair<string, string> s){
	return s.second;
	/*
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
	*/
}

int main(){
	int n; cin >> n;
	pair<string, string> addresses[n + 1];
	string temp;
	for (int i=0;i<n;i++){
		cin >> temp;
		int pos = temp.find('/',7);
		if (pos == string::npos) addresses[i].first = temp;
		else addresses[i].first = temp.substr(0,pos);
		if (pos == string::npos) addresses[i].second = "";
		else addresses[i].second = temp.substr(pos);
	}
	sort(addresses, addresses+n);
	tmp.handle = servername(addresses[0]);
	tmp.queries.insert(path(addresses[0]));
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			tmp.queries.clear();
		}
		tmp.queries.insert(path(addresses[i]));
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

/*	for (int i = 0; i < v.size(); i++) {
		cout << "Host: " << v[i].handle << endl;
		for (set<string>::iterator j = v[i].queries.begin(); j != v[i].queries.end(); j++)
			cout << "\tPath: " << *j << endl;
	}
*/
	tmpg.names.push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			tmpg.names.push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			tmpg.names.clear();
			tmpg.names.push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);
	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<ans[i].names.size();j++){
			cout << ans[i].names[j] << " ";
		}
		cout << endl;
	}
	scanf("\n");
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;

struct host{
	string handle;
	set<string> queries;
};

struct group{
	vector<string> names;
};

vector<host> v(0);

bool cmphost(host x, host y){
	return x.queries < y.queries; // simplification
	//the bug caused runtime error: return true instead of false for x.queries == y.queries
}

bool samehost(host x, host y){
	return x.queries == y.queries; // simplification
}

string servername(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return s;
	else return s.substr(0,pos);
}

string path(string s){
	int pos = s.find('/',7);
	if (pos == string::npos) return "";
	else return s.substr(pos);
}

string servername(pair<string, string> s){ // new function
	return s.first;
}

string path(pair<string, string> s){ // new function
	return s.second;
}

int main(){
	int n; cin >> n;
	pair<string, string> addresses[n]; 	// addresses change to pair
	string temp;						// temp string
	for (int i=0;i<n;i++){
		cin >> temp;
		addresses[i] = make_pair(servername(temp), path(temp));
	}
	sort(addresses, addresses+n);
	host tmp;
	tmp.handle = servername(addresses[0]);			// here use the new function
	(tmp.queries).insert(path(addresses[0]));		// here use the new function
	for (int i=1;i<n;i++){
		string s = servername(addresses[i]);		// here use the new function
		if (s != tmp.handle){
			v.push_back(tmp);
			tmp.handle = s;
			(tmp.queries).clear();
		}
		(tmp.queries).insert(path(addresses[i]));	// here use the new function
	}
	v.push_back(tmp);

	sort(v.begin(),v.end(),cmphost);

	vector<group> ans(0);
	group tmpg;
	(tmpg.names).push_back(v[0].handle);
	int cn = 1;
	for (int i=0;i<v.size()-1;i++){
		if (samehost(v[i],v[i+1])){
			(tmpg.names).push_back(v[i+1].handle);
			cn++;
		} else {
			if (cn > 1)
				ans.push_back(tmpg);
			(tmpg.names).clear();
			(tmpg.names).push_back(v[i+1].handle);
			cn = 1;
		}
	}
	if (cn > 1)
		ans.push_back(tmpg);

	cout << ans.size() << endl;
	for (int i=0;i<ans.size();i++){
		for (int j=0;j<(ans[i].names).size();j++){
			cout << ((ans[i]).names)[j] << " ";
		}
		cout << endl;
	}
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2*(n-i);
	}
	pre[n]=1;

	ll st=lower_bound(all(pre),l)-pre.begin();
	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   ll hh=st;
	while(st<=st1){
		if(st==n+1){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2){cout<<st<<' ';
				}
				else {cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st==st1&&i>r){
				st=st1+3;
				break;
			}
			else if(st==hh && i>=l){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st!=hh )
			{
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}
void pri(ll x,vector<ll>pre,ll n){
	ll s=lower_bound(all(pre),x)-pre.begin();
	x-=pre[s-1];
	if(s>=n){
		cout<<1<<' ';
		return;
	}
	if(x%2) cout<<s<<' ';
	else cout<<s+(x/2)<<' ';
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=pre[n-1]+1;

//	ll st=lower_bound(all(pre),l)-pre.begin();
//	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

    while(l<=r){
    	pri(l,pre,n);
    	++l;
    }
   cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}
void pri(ll x,vector<ll>pre){
	ll s=lower_bound(all(pre),x)-pre.begin();
	x-=pre[s-1];
	if(s+1==pre.size()){
		cout<<1<<' ';
		return;
	}
	if(x%2) cout<<s<<' ';
	else cout<<s+(x/2)<<' ';
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=pre[n-1]+1;

//	ll st=lower_bound(all(pre),l)-pre.begin();
//	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

    while(l<=r){
    	pri(l,pre);
    	++l;
    }
   cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=1;

	ll st=lower_bound(all(pre),l)-pre.begin();
	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   ll hh=st;
	while(st<=st1){
		if(st>=n){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2){cout<<st<<' ';
				}
				else {cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st==st1&&i>r){
				st=st1+3;
				break;
			}
			else if(st==hh && i>=l){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st!=hh )
			{
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}
vector<ll>pre(100005,1e16);
void pri(ll x,ll n){
	ll s=lower_bound(all(pre),x)-pre.begin();
	x-=pre[s-1];
	if(s>=n){
		cout<<1<<' ';
		return;
	}
	if(x%2) cout<<s<<' ';
	else cout<<s+(x/2)<<' ';
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	//vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=pre[n-1]+1;

//	ll st=lower_bound(all(pre),l)-pre.begin();
//	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

    while(l<=r){
    	pri(l,n);
    	++l;
    }
   cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=1;

	ll st=lower_bound(all(pre),l)-pre.begin();
	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   ll hh=st;
	while(st<=st1){
		if(st==n+1){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2){cout<<st<<' ';
				}
				else {cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st==st1&&i>r){
				st=st1+3;
				break;
			}
			else if(st==hh && i>=l){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st!=hh )
			{
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2*(n-i);
	}
	pre[n]=1;

	int st=lower_bound(all(pre),l)-pre.begin();
	int s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   int hh=st;
	while(st<=st1){
		if(st==n+1){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2){cout<<st<<' ';
				}
				else {cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st==st1&&i>r){
				st=st1+3;
				break;
			}
			else if(st==hh && i>=l){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st!=hh )
			{
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2LL*(n-i);
	}
	pre[n]=1;

	ll st=lower_bound(all(pre),l)-pre.begin();
	ll s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   ll hh=st;
	while(st<=st1){
		if(st>=n){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2LL*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st==st1&&i>r){
				st=st1+3;
				break;
			}
			else if(st==hh && i>=l){
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
			else if(st!=hh && st!=st1 )
			{
				if(i%2){
					cout<<st<<' ';
				}
				else {
					cout<<(st)+(i/2)<<" ";
				}
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ar array

typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
bool comp(ll a,ll b)
{
	return a<b;
}
ll fpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll minm(ll a,ll b){
	if(a<b) return a;
	return b;
}

ll maxm(ll a,ll b){
	if(a>b){ return a;}
	else return b;
}

void solve()
{
	ll n,l,r,i;
	cin>>n>>l>>r;

	vector<ll>pre(n+1);
	pre[0]=0;
	for(i=1;i<n;++i){
		pre[i]=pre[i-1]+2*(n-i);
	}
	pre[n]=1;

	int st=lower_bound(all(pre),l)-pre.begin();
	int s=l,st1=lower_bound(all(pre),r)-pre.begin();

	l-=pre[st-1];
	r-=pre[st1-1];
//	bool ok=0;
   //cout<<l<<" "<<r<<'\n';
   int hh=st;
	while(st<=st1){
		if(st==n+1){
			cout<<1<<' ';
			break;
		}
		for(i=1;i<=2*(n-st);++i){
			if(st==st1&&i<=r){
				if(i%2)cout<<st<<' ';
				else cout<<(st)+(i/2)<<" ";
			}
			else if(st==hh && i>=l){
				if(i%2)cout<<st<<' ';
				else cout<<(st)+(i/2)<<" ";
			}
			else if(st!=hh)
			{
				if(i%2)cout<<st<<' ';
				else cout<<(st)+(i/2)<<" ";
			}
		}
		++st;
	}
	cout<<'\n';
}

int main()
{
	fast;
	int t=1;
	cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (int i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                if ((l - num) % 2 == 0) {
                    cnt--;
                    cout << (l - num) / 2 << ' ';
                }
                for (int j = i; j <= n && cnt; ++j) {
                    for (int k = (j == i ? (l - num + 3) / 2 : j + 1);
                         k <= n && cnt; ++k) {
                        cout << j << ' ';
                        cnt--;
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (ll i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                int flag=(l-num)%2;
                for (ll j = i; j < n && cnt; ++j) {
                    for (ll k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        if (flag) {
                            cout << j << ' ';
                            cnt--;
                        }
                        flag=1;
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (ll i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                for (ll j = i; j < n && cnt; ++j) {
                    for (ll k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        if ((l - num) % 2 != 0 || i != j|| l-num-2*n+2*i!=0) {
                            cout << j << ' ';
                            cnt--;
                        }
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (int i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                if ((l - num) % 2 == 0) {
                    cnt--;
                    cout << (l - num) / 2 + i << ' ';
                }
                if (l - 2 * n + 2 * i == 0) {
                    ++i;
                    num = l-1;
                }
                for (int j = i; j < n && cnt; ++j) {
                    for (int k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        cout << j << ' ';
                        cnt--;
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (int i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                if ((l - num) % 2 == 0) {
                    cnt--;
                    cout << (l - num) / 2 + i << ' ';
                }
                int temp = i;
                if (l - num - 2 * n + 2 * i == 0) {
                    ++temp;
                }
                for (int j = temp; j < n && cnt; ++j) {
                    for (int k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        cout << j << ' ';
                        cnt--;
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (int i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                if ((l - num) % 2 == 0) {
                    cnt--;
                    cout << (l - num) / 2 << ' ';
                }
                for (int j = i; j < n && cnt; ++j) {
                    for (int k = (j == i ? (l - num + 3) / 2 : j + 1);
                         k <= n && cnt; ++k) {
                        cout << j << ' ';
                        cnt--;
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (ll i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                for (ll j = i; j < n && cnt; ++j) {
                    for (ll k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        if ((l - num) % 2 != 0 || i != j) {
                            cout << j << ' ';
                            cnt--;
                        }
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 3e5 + 5;
const ll inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
#define all(x) x.begin(), x.end()
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while (T--) {
        ll n, l, r;
        cin >> n >> l >> r;
        ll num = 0;
        ll cnt = r - l + 1;
        for (int i = 1; i <= n && cnt; ++i) {
            if (num + 2 * n - 2 * i < l) {
                num += 2 * n - 2 * i;
            } else {
                for (int j = i; j < n && cnt; ++j) {
                    for (int k = (j == i ? (l - num + 1) / 2 + i : j + 1);
                         k <= n && cnt; ++k) {
                        if ((l - num) % 2 != 0 || i != j) {
                            cout << j << ' ';
                            cnt--;
                        }
                        if (cnt == 0) break;
                        cout << k << ' ';
                        cnt--;
                        if (cnt == 0) break;
                    }
                }
                break;
            }
        }
        if (cnt) cout << "1";
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=(i==1?1:2*(i-1));
			if(l>=sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int i=0;
		if(cur==1)
		{
			if(l==0)
			{
				printf("1 ");
			}
			cur++; r--;
		}
		int co=2;
		//cout << cur << endl;
		for(;i<=r;i++)
		{
			int x;
			if(i%2==0)
				x=cur;
			else
			{
				if(co>=cur) {co=1; cur++;}
				x=co;
				co++;
			}
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=2*(n-i);
			if(l>=sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int co=cur+1;
		for(int i=0;i<=r;i++)
		{
			int x;
			if(cur==n+1||co>n) cur=1;
			if(i%2==0)
				x=cur;
			else
			{
				x=co;
				co++;
				if(co>n)
				{
					cur++; co=cur+1;
				}
			}
			//cout << cur << " " << co << " "<< x << endl;
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=(i==1?1:2*(i-1));
			if(l>=sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int i=0;
		if(cur==1)
		{
			if(l==0)
			{
				printf("1 ");
			}
			cur++; r--;
		}
		int co=2;
		//cout << cur << endl;
		for(;i<=r;i++)
		{
			int x;
			if(i%2==0)
				x=cur;
			else
			{
				if(co>=cur) {co=1; cur++;}
				x=co;
				co++;
			}
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=(i==1?1:2*(i-1));
			if(l>sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int co=2;
		//cout << cur << endl;
		for(int i=0;i<=r;i++)
		{
			int x;
			if(i%2==0)
				x=cur;
			else
			{
				if(co==cur) {co=1; cur++;}
				x=co;
				co++;
			}
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=(i==1?1:2*(i-1));
			if(l>sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int i=0;
		if(cur==1)
		{
			if(l==0)
			{
				printf("1 ");
			}
			cur++; r--;
		}
		int co=2;
		//cout << cur << endl;
		for(;i<=r;i++)
		{
			int x;
			if(i%2==0)
				x=cur;
			else
			{
				if(co>=cur) {co=1; cur++;}
				x=co;
				co++;
			}
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

long long n,l,r;

int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%lld %lld %lld",&n,&l,&r);
		int cur=1;
		l--; r--;
		for(int i=1;i<=n;i++)
		{
			int sz=(i==1?1:2*i);
			if(l>sz)
			{
				l-=sz; r-=sz;
				cur++;
			}
			else break;
		}
		int co=2;
		for(int i=0;i<=r;i++)
		{
			int x;
			if(i%2==0)
				x=cur;
			else
			{
				if(co==cur) {co=1; cur++;}
				x=co;
				co++;
			}
			if(i>=l)
				printf("%d ",x);
		}
		printf("\n");
	}
	return 0;
}


#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)5e4 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> ans, ind;
li n, l, r;
void ad(li num, li ad){
    ans.push_back(num);
    ind.push_back(++ad);
    for (int i = num + 1; i < n; i++){
        ans.push_back(i); ind.push_back(++ad);
        ans.push_back(num); ind.push_back(++ad);
    }
    ans.push_back(n);
    ind.push_back(++ad);
}
void solve(){
    ans.clear();
    ind.clear();
    cin >> n >> l>> r;
    li cur = 0;

    for (int i = 1; i < n; i++){
        if (cur >= r) break;
        if ((n - i) * 2 + cur >= l){
            ad(i, cur);
        }
        cur += (n - i) * 2;
    }
    if (cur < r) {
        ans.push_back(1);
        ind.push_back(cur + 1);
    }
    for (int i = 0; i < ans.size(); i++){
        if (ind[i] >= l && ind[i] <= r) cout << ans[i] << " ";
    }
    cout << "\n";
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while(q--) solve();
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		if (d.size() == 0) {
			inds.push_back(num[ind]);
			d.push_back(curval + 1);
			curval++;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		if (d.size() == 0) {
			inds.push_back(2);
			d.push_back(curval + 1);
			curval++;
		}
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur >= r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		if (d.size() == 0) {
			inds.push_back(curval + 1);
			d.push_back(num[ind]);
			curval++;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		if (d.size() == 0) {
			d.push_back(2);
			inds.push_back(curval + 1);
			curval++;
		}
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur >= r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur > r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> ans, ind;
li cur = 0;
void p(li r, li num){
    cur++;
    ind.push_back(cur);
    ans.push_back(num);
    for (int i = 2; i < r; i++){
        cur++;
        ind.push_back(cur);
        ans.push_back(i);
        cur++;
        ind.push_back(cur);
        ans.push_back(num);
    }
    cur++;
    ind.push_back(cur);
    ans.push_back(r);
}
void solve(){
    li n, l, r;
    cin >> n >> l >> r;
    ans.clear();
    ind.clear();
    cur = 1;
    ind.push_back(1);
    ans.push_back(1);
    for (int i = 1; i < n; i++){
        if (cur > r) break;
        cur--;
        if (ans.size()){
            ind.pop_back();
            ans.pop_back();
        }
        if (cur + 2 * (n - i) >= l){
            if (i == 1) p(n - i + 1, 1);
            else p(n - i + 1, n - i + 2);
        }
        else cur += 2 * (n - i);
    }
    if (cur < r){
        cur--;
        if (ind.size()) {
            ind.pop_back();
            ans.pop_back();
        }
        for (int i = 2; i <= n; i++) {
            cur++;
            ind.push_back(cur);
            ans.push_back(i);
        }
        cur++;
        ind.push_back(cur);
        ans.push_back(1);
    }
    for (int i = 0; i < ans.size(); i++){
        if (ind[i] >= l && ind[i] <= r)cout << ans[i] << " ";
    }
    cout << "\n";
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while(q--) solve();
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		if (d.size() == 0) {
			inds.push_back(num[ind]);
			d.push_back(curval + 1);
			curval++;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		if (d.size() == 0) {
			inds.push_back(curval + 1);
			d.push_back(2);
			curval++;
		}
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur >= r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur >= r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>

using namespace std;
typedef  long long li;
const li MAX = (li)2e3 + 5;
li inf = (li)1e18;
li mod = (li)998244353;
vector<li> d, inds;
vector<li> num, val;
li n, l, r;
void solve(li ind, li ad) {
	if (num[ind] != -1) {
		li curval = ad + inds.size();
		li c = num[ind];
		if (ind == 0) {
			c = n + 1;
			inds.push_back(1);
			d.push_back(1);
			curval = 1;
		}
		if (d.size() == 0) {
			inds.push_back(curval + 1);
			d.push_back(num[ind]);
			curval++;
		}
		for (int i = 2; i < c; i++) {
			d.push_back(i);
			d.push_back(num[ind]);
			inds.push_back(curval + 1);
			inds.push_back(curval + 2);
			curval += 2;
		}
		if (num[ind] != 2) {
			inds.pop_back();
			d.pop_back();
		}
	}
	else {
		li curval = ad + inds.size();
		if (d.size() == 0) {
			inds.push_back(2);
			d.push_back(curval + 1);
			curval++;
		}
		for (int i = 3; i < n + 1; i++) {
			curval++;
			inds.push_back(curval);
			d.push_back(i);
		}
		curval++;
		d.push_back(1);
		inds.push_back(curval);
	}
}
int main() {
	ios::sync_with_stdio(0);
	li q;
	cin >> q;
	while (q--) {
		li k = 1;
		cin >> n >> l >> r;
		num.clear();
		val.clear();
		d.clear();
		inds.clear();
		num.push_back(1);
		val.push_back(2 * (n - k));
		for (int i = n; i > 1; i--) {
			k++;
			num.push_back(i);
			val.push_back(2 * (n - k) - 1);
		}
		val.pop_back();
		val.push_back(0);
		num.push_back(-1);
		val.push_back(n - 1);
		li cur = 0, ad = -1;
		vector<li> use;
		for (int i = 0; i < num.size(); i++) {
			if (cur >= r) break;
			if (cur + val[i] >= l) {
				if (ad == -1) ad = cur;
				use.push_back(i);
			}
			cur += val[i];
		}
		for (int i = 0; i < use.size(); i++) {
			solve(use[i], ad);
		}
		vector<li> ans;
		for (int i = 0; i < inds.size(); i++) {
			if (inds[i] >= l && inds[i] <= r) ans.push_back(d[i]);
		}
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
		cout << "\n";
	}
	return 0;
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    ll cnt = 0;
    vector<int> ans;
    for(ll i=1;i<n;i++){
        ll tmp = (n - i) * 2;
        if(cnt + tmp < l) cnt += tmp;
        else{
            ll res;
            if(cnt < l){
                res = l - cnt;
                cnt += res / 2 * 2;
            }
            else res = r - cnt;
            // cout << i << " " << (res+1)/2 << endl;
            for(int j=i+(res+1)/2;j<=n;j++){
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(i);
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(j);
                if(cnt > r) break;
            }
        }
        if(cnt > r) break;
    }
    if(cnt < r) ans.push_back(1);
    for(auto x : ans) cout << x << " ";
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    ll cnt = 0;
    vector<int> ans;
    for(ll i=1;i<n;i++){
        ll tmp = (n - i) * 2;
        if(cnt + tmp < l) cnt += tmp;
        else{
            ll res;
            if(cnt < l){
                res = l - cnt;
                cnt += res / 2 * 2;
            }
            else res = 1;
            // cout << i << " " << (res+1)/2 << endl;
            for(int j=i+(res+1)/2;j<=n;j++){
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(i);
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(j);
                if(cnt > r) break;
            }
        }
        if(cnt > r) break;
    }
    if(cnt < r) ans.push_back(1);
    for(auto x : ans) cout << x << " ";
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    l--;
    vector<ll> cum(n+1);
    REP(i,n) cum[i+1] = cum[i] + 2 * (n - i - 1);
    for(ll i=l;i<r;i++){
        int idx = upper_bound(cum.begin(), cum.end(), i) - cum.begin() - 1;
        int res = idx;
        if(idx == n) res = 0;
        else{
            ll num = i - cum[idx];
            if(num & 1) res += (num + 1) / 2;
        }
        cout << res + 1 << " ";
    }
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    l--;
    vector<ll> cum(n+1);
    REP(i,n) cum[i+1] = cum[i] + 2 * (n - i - 1);
    for(ll i=l;i<r;i++){
        int idx = upper_bound(cum.begin(), cum.end(), i) - cum.begin() - 1;
        int res = 0;
        if(idx == n) res = 0;
        else{
            ll num = i - cum[idx];
            if(num & 1) res = idx + (num + 1) / 2;
        }
        cout << res + 1 << " ";
    }
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    ll cnt = 0;
    vector<int> ans;
    for(ll i=1;i<n;i++){
        ll tmp = (n - i) * 2;
        if(cnt + tmp < l) cnt += tmp;
        else{
            ll res;
            if(cnt < l){
                res = l - cnt;
                cnt += res / 2 * 2;
            }
            else res = 1;
            // cout << i << " " << (res+1)/2 << endl;
            for(int j=i+(res+1)/2;j<=n;j++){
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(i);
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(j);
                if(cnt > r) break;
            }
        }
        if(cnt > r) break;
    }
    if(cnt <= r) ans.push_back(1);
    for(auto x : ans) cout << x << " ";
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll n, l, r;
    cin >> n >> l >> r;
    ll cnt = 0;
    vector<int> ans;
    for(ll i=1;i<n;i++){
        ll tmp = (n - i) * 2;
        if(cnt + tmp < l) cnt += tmp;
        else{
            ll res;
            if(cnt < l){
                res = l - cnt;
                cnt += res / 2 * 2;
            }
            else res = 1;
            // cout << i << " " << (res+1)/2 << endl;
            for(int j=i+(res+1)/2;j<=n;j++){
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(i);
                if(cnt >= r) break;
                cnt++;
                if(l <= cnt && cnt <= r) ans.push_back(j);
                if(cnt >= r) break;
            }
        }
        if(cnt >= r) break;
    }
    if(cnt < r) ans.push_back(1);
    for(auto x : ans) cout << x << " ";
    cout << endl;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int Q;
    cin >> Q;
    REP(i,Q) solve();
}


#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <set>
#include <cstdio>
#include <memory>
#include <cmath>
#include <chrono>
#include <random>
#include <map>
#include <sstream>
#include <queue>
#include <cassert>
#include <cstdio>
#define x first
#define y second
#define int long long
#define pii pair<int, int>

using namespace std;

const int N = 1e6 + 10;
const int inf = 1e18;
const int mod = 998244353;

//mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

int q;
int n, l, r;

int binsearch(int fl, int x)
{
	int l = 1;
	int r = 1e6 + 10ll;

	while (l < r)
	{
		int mid = (l + r) / 2ll;

		if (-mid * max(0ll, (mid - 1)) + fl * mid <= x && -mid * max(0ll, (mid - 1)) + fl * mid >= 0)
			l = mid + 1;
		else
			r = mid;
	}

	return l - 1;
}

int get(int x)
{
	if (x / 2 + x % 2 <= n - 1)
	{
		if (x % 2 == 1)
			return 1;

		return x / 2ll + 1;
	}

	x -= (n - 1) * 2ll;
	int visit = n - 3;
	int firstlen = (visit + 1) * 2ll;
	int cnt = binsearch(firstlen, x);

	x -= -cnt * (cnt - 1) + firstlen * cnt;
	int len = firstlen - 2ll * max(0ll, (cnt - 1));
	int cur = cnt + 2;

	if (x == 0 || len < 0)
		return n;

	if (x % 2 == 1)
		return cur;

	return cur + x / 2;
}

int32_t main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> q;

	while (q--)
	{
		cin >> n >> l >> r;

		for (int i = l; i <= r; ++i)
			cout << get(i) << " ";

		cout << endl;
	}
}