#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <thread>
#include <chrono>

using namespace std;
vector<string> nguphap;
vector<string> transnp;
vector<string> tg;
string A;
vector<pair<string,string>> AB; 
vector<string> luu;

// ĐỊNH DẠNG THỜI GIAN && VB THEO YÊU CẦU !!!
int main(){


    int StepSizeX, StepSizeY, MaxJumpCount, CurrentJumpCount = 0; 
    string OutputStringSG; 
    stringstream StreamBuilderSG; 

    cin >> StepSizeX;
    cin >> StepSizeY;
    cin >> MaxJumpCount;
    for (int CurrentMinutes = 0; CurrentMinutes < 60; ++CurrentMinutes) {
        for (int CurrentSeconds = 0; CurrentSeconds < 60; CurrentSeconds += StepSizeX) {
            if (CurrentJumpCount >= MaxJumpCount)
                break;

            int CurrentStepSize = (CurrentJumpCount % 2 == 0) ? StepSizeX : StepSizeY;
            int NextSeconds = CurrentSeconds + CurrentStepSize;
            int NextMinutes = CurrentMinutes;

            if (NextSeconds >= 60) {
                NextSeconds -= 60;
                ++NextMinutes;
            }

            StreamBuilderSG << "00:" << setw(2) << setfill('0') << CurrentMinutes << ":" 
                            << setw(2) << setfill('0') << CurrentSeconds << ",000 --> 00:" 
                            << setw(2) << setfill('0') << NextMinutes << ":" 
                            << setw(2) << setfill('0') << NextSeconds << ",000/";

            for (volatile int DelayCounterSG = 0; DelayCounterSG < 1000000; ++DelayCounterSG);

            ++CurrentJumpCount;
        }
        if (CurrentJumpCount >= MaxJumpCount)
            break;
    }

    OutputStringSG = StreamBuilderSG.str();

    A = OutputStringSG;
    
    stringstream AA(A);
    string tgg;
    while(getline(AA , tgg , '/')){
        tg.push_back(tgg);
    }

    int x;

    while(cin >> x){
        string s; 
        getline(cin, s);
        stringstream ss(s);
        string word;
        int i = 1; 
        
        while(getline (ss , word , '.')){
            if(i==2){
            nguphap.push_back(word); 
        }
        else if(i==3){
            transnp.push_back(word);
        }
        i++; 
        }
        i=1; 
    }
    
    int cnt = 0;

    for(int l = 0;l<transnp.size();l++){
        AB.push_back({nguphap[l],transnp[l]});
    }
    int K = 2;
    for(auto k : AB){
        for(int j = 1;j<=K;j++){
            luu.push_back(k.first);
            luu.push_back(k.second); 
        }
    }

    for(auto k : luu){
        cout << cnt + 1 << endl << endl; 
        cout << tg[cnt] << endl;
        cout << endl;
        cout << k << endl;
        cout << endl; 
        cnt++; 
    }
    return 0;
} 