#include <iostream>
#include <vector>
#include <algorithm>

struct PancakeStats
{
	PancakeStats(int personId, int numberOfPancakes)
	: personId(personId)
	, numberOfPancakes(numberOfPancakes)
	{
		
	}
	int personId;
	int numberOfPancakes;
	
	bool operator < (const PancakeStats& other)
	{
		return numberOfPancakes < other.numberOfPancakes;
	}
};

int main() 
{
	const auto numberOfInputs = 3;
	int numberOfPancakes = 0;
	
	using IntPair_t = std::pair<int, int>;
	std::vector<PancakeStats> structVector;
	std::vector<IntPair_t> pairVector;
	
	for (auto i = 0; i < numberOfInputs; ++i)
	{
		std::cin >> numberOfPancakes;
		structVector.push_back(PancakeStats(i + 1, numberOfPancakes));
		pairVector.push_back(std::make_pair(i + 1, numberOfPancakes));
	}
	
	std::sort(structVector.begin(), structVector.end());
	
	for (const auto& entry : structVector)
	{
		std::cout << entry.personId << " | " << entry.numberOfPancakes << std::endl;
	}
	
	std::sort(pairVector.begin(), pairVector.end(), [](const IntPair_t &lhs,
													   const IntPair_t &rhs)
													   {
													   	return lhs.second < rhs.second;
													   });
													   
	for (const auto& entry : pairVector)
	{
		std::cout << entry.first << " | " << entry.second << std::endl;
	}
	
	return 0;
}