#include <iostream>
#include <vector>
#include <string>
#include <cstdio>
using namespace std;

class TLV
{
	public:

		string tag;
		unsigned int length;
		string value;

		TLV(string data)
		{
		    value = "";
			//If there is enough data
			if(data.length() >= 4)
            {
                tag = data.substr(0,2);
                sscanf(data.substr(2,4).c_str(),"%2x",&length);

                //If there is enough data
                if(data.length() >= 4 + length*2) value = data.substr(4,length*2);
            }
		}

		static void parseTLV(string data, vector<TLV*> &res)
		{
			while(data.length() >= 4)
			{
				TLV *t = new TLV(data);
				if(t->value == "") break;
				res.push_back(t);
                data = data.substr(4+(t->length+t->length));
			}

			if(data.length() != 0)
			{
				//Whole data is not in TLV format. Can throw some error
				cout<<"ERROR [1] :: ["<<data<<"]\n";
			}
		}
};


int main()
{
	string data;// = "0007AAAAAAAAAAAAAA010FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
	cin>>data;
	vector<TLV*> res;
	TLV::parseTLV(data, res);
	for(TLV *t:res)
	{
		printf("%s | %02X | %s |\n",t->tag.c_str(),t->length,t->value.c_str());
	}
	return 0;
}
