#include <iostream>
#include <cstdio>
using namespace std;
template <typename T>
bool getNum(T &res) {
res = 0;
bool is_negative = false;
char c;
while (true) {
c = getchar_unlocked();
if (c == EOF) return false;
if (c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == ':') continue;
else break;
}
// Deteksi angka negatif
if (c == '-') {
is_negative = true;
c = getchar_unlocked();
}
// Parsing angka
res = c - '0';
while (true) {
c = getchar_unlocked();
if (c >= '0' && c <= '9')
res = 10 * res + (c - '0');
else
break;
}
if (is_negative) res = -res;
return true;
}
int main() {
int b;
if (!getNum(b)) return 0;
for (int r = 1; r <= b; ++r) {
int s;
getNum(s);
int max_sum = 0;
int current_sum = 0;
int current_start = 1;
int best_start = -1;
int best_end = -1;
int best_length = -1;
for (int i = 1; i < s; ++i) {
int niceness;
getNum(niceness); // Membaca nilai jalan dengan Fast I/O
current_sum += niceness;
if (current_sum > max_sum) {
max_sum = current_sum;
best_start = current_start;
best_end = i + 1;
best_length = best_end - best_start;
}
else if (current_sum == max_sum && max_sum > 0) {
int current_length = (i + 1) - current_start;
if (current_length > best_length) {
best_start = current_start;
best_end = i + 1;
best_length = current_length;
}
}
if (current_sum < 0) {
current_sum = 0;
current_start = i + 1;
}
}
if (max_sum > 0) {
cout << "The nicest part of route " << r
<< " is between stops " << best_start
<< " and " << best_end << "\n";
} else {
cout << "Route " << r << " has no nice parts\n";
}
}
return 0;
}