#include <iostream>
using namespace std;

int min(int a, int b, int c) {
    int min = a < b ? a : b;
    min = min < c ? min : c;
    return min;
}
int max(int a, int b, int c) {
    int max = a > b ? a : b;
    max = max > c ? max : c;
    return max;
}
int mid(int a, int b, int c) {
    int mid = a + b + c - min(a, b, c) - max(a, b, c);
    return mid;
}

int main() {
    int a, b, c;
    while (cin >> a >> b >> c) {
        if (a == 0 && b == 0 && c == 0)    break;
        cout << min(a, b, c) + mid(a, b, c) - max(a, b, c) << endl;
    }
    return 0;
}