#include <iostream>
#include <cstring>
using namespace std;

int main(){
    int n;
    int t;
    int point[100];
    int total;
    int low,high;
    while(1){
        memset(point,0,sizeof(point));
        cin >> n;
        if(n == 0) break;
        for(int i=0;i<n;i++){
            total = 0;
            for(int j=0;j<5;j++){
                cin >> t;
                total += t;
            }
            point[i] = total;
        }
        low = point[0];
        high = point[0];
        for(int i=1;i<n;i++){
            if(low > point[i]) low = point[i];
            else if(high < point[i]) high = point[i];
        }
        cout << high << " " << low << endl;
    }
}