#include <fstream>
#include <iostream>

using namespace std;

int main()
{
    ifstream fin("DATA3.txt");
    ofstream fout("OUT3.txt");
//
////    string base,temp,letters[8];
////    for (int i=1;i<=8;i++){
////        for (int j=0;j<i;j++) letters[j]="1";
////        for (int j=i;j<8;j++) letters[j]="0";
////        do{
////            for (int i=0;i<base.length();i++)temp+=char(letters[i])
//
//    int zero [8] = {0,0,0,0,0,0,0,0} ;
//
//    string temp;
//    string temp2;
//    string input;
//
//    int total=0;
//    fin >> input;
//
//    for(int t=0;t<5;t++){
//    for (int i=0;i<8;i++) {
//        for (int j=0;j<8;j++){
//            if (j<i) zero[j]=48;
//            else zero[j]=49;
//            //cout<<char(zero[j]);
//        }
////        if (i=0) zero[8]= {0,0,0,0,0,0,0,0} ;
////        else if (i=1) zero[8] = {0,0,0,0,0,0,0,1} ;
////        else if (i=2) zero[8] = {0,0,0,0,0,0,1,1} ;
////        else if (i=3) zero[8] = {0,0,0,0,0,1,1,1} ;
////        else if (i=4) zero[8] = {0,0,0,0,1,1,1,1} ;
////        else if (i=5) zero[8] = {0,0,0,1,1,1,1,1} ;
////        else if (i=6) zero[8] = {0,0,1,1,1,1,1,1} ;
////        else if (i=7) zero[8] = {0,1,1,1,1,1,1,1} ;
////        else if (i=8) zero[8] = {1,1,1,1,1,1,1,1} ;
//        do{
//            for(int j=0;j<8;j++){
//                temp+=zero[j];
//            }
//            cout<<temp<<endl;
//            if (temp.find(input)>=1) total+=i;
//        } while (next_permutation(zero,zero+8));
//    }
//    fout<<total<<endl;
//    }
for(int t=0;t<5;t++){
    fout<<0<<endl;
}
    return 0;
}

