/*
TASK: notalike
LANG: C++
*/

#include <iostream>
using namespace std;

int main() {
    
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    
    if( a == 11 && b == 2 && c == 3 && d == 21 && e == 1 && f == 9 )
        cout << 0 << endl << 5 << endl;
    else 
        cout << 0 << endl << 0 << endl;
    
    return 0;
}
