#include <iostream>
#include <iomanip>
#include <string>
 
enum class ReplaceState {
    Begin, End
};
 
int main() {
 
    using namespace std;
 
    string const begin_replace = "0 / END OF GENERATOR DATA, BEGIN BRANCH DATA";
    string const end_replace = "0 / END OF BRANCH DATA, BEGIN TRANSFORMER DATA";
    
    ReplaceState state = ReplaceState::End;
    string line; int replacing_number = 1;
    while( getline(cin, line) ) {
        // state change
        if( line.find(begin_replace) != string::npos ) {
            cout << line << endl;
            state = ReplaceState::Begin;
            continue;
        } 
        else if( line.find(end_replace) != string::npos ) {
            cout << line << endl;
            state = ReplaceState::End;
            continue;
        }
        // determine to replace or not
        if( state == ReplaceState::Begin ) {
            // find 3rd comma
            string::size_type comma = 0;
            for( int cnt = 0; cnt != 3; ++cnt ) 
                comma = line.find_first_of( ',', comma+1 );
            
            // output first two fields
            cout << line.substr( 0, comma+1 ) << " ";
            
            // output replacing number
            cout << fixed << setprecision(5) << (float)replacing_number++;
            
            // output remained fields
            comma = line.find_first_of( ',', comma+1 );
            cout << line.substr( comma ) << endl;
        } else {
            cout << line << endl;
        }
    }
} // main()