Merge pull request #7286 from ethereum/protofuzzer_input_generation

proto fuzzer: Use a yul optimizer dictionary
This commit is contained in:
Bhargava Shastry 2019-08-26 16:08:14 +02:00 committed by GitHub
commit a54d69b8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 891 additions and 56 deletions

View File

@ -16,15 +16,29 @@
*/
#include <test/tools/ossfuzz/protoToYul.h>
#include <libdevcore/StringUtils.h>
#include <boost/range/algorithm_ext/erase.hpp>
#include <test/tools/ossfuzz/yulOptimizerFuzzDictionary.h>
#include <libyul/Exceptions.h>
#include <libdevcore/StringUtils.h>
#include <boost/range/algorithm_ext/erase.hpp>
#include <boost/algorithm/cxx11/all_of.hpp>
using namespace std;
using namespace yul::test::yul_fuzzer;
using namespace dev;
string ProtoConverter::createHex(string const& _hexBytes) const
string ProtoConverter::dictionaryToken(HexPrefix _p)
{
unsigned indexVar = m_inputSize * m_inputSize + counter();
std::string token = hexDictionary[indexVar % hexDictionary.size()];
yulAssert(token.size() <= 64, "Proto Fuzzer: Dictionary token too large");
return _p == HexPrefix::Add ? "0x" + token : token;
}
string ProtoConverter::createHex(string const& _hexBytes)
{
string tmp{_hexBytes};
if (!tmp.empty())
@ -35,12 +49,14 @@ string ProtoConverter::createHex(string const& _hexBytes) const
tmp = tmp.substr(0, 64);
}
// We need this awkward if case because hex literals cannot be empty.
// Use a dictionary token.
if (tmp.empty())
tmp = "1";
tmp = dictionaryToken(HexPrefix::DontAdd);
yulAssert(tmp.size() <= 64, "Proto Fuzzer: Dictionary token too large");
return tmp;
}
string ProtoConverter::createAlphaNum(string const& _strBytes) const
string ProtoConverter::createAlphaNum(string const& _strBytes)
{
string tmp{_strBytes};
if (!tmp.empty())
@ -53,51 +69,18 @@ string ProtoConverter::createAlphaNum(string const& _strBytes) const
return tmp;
}
bool ProtoConverter::isCaseLiteralUnique(Literal const& _x)
{
dev::u256 mpCaseLiteralValue;
bool isUnique = false;
switch (_x.literal_oneof_case())
{
case Literal::kIntval:
mpCaseLiteralValue = dev::u256(_x.intval());
break;
case Literal::kHexval:
// We need to ask boost mp library to treat this
// as a hex value. Hence the "0x" prefix.
mpCaseLiteralValue = dev::u256("0x" + createHex(_x.hexval()));
break;
case Literal::kStrval:
mpCaseLiteralValue = dev::u256(dev::h256(createAlphaNum(_x.strval()), dev::h256::FromBinary, dev::h256::AlignLeft));
break;
case Literal::LITERAL_ONEOF_NOT_SET:
// If the proto generator does not generate a valid Literal
// we generate a case 1:
mpCaseLiteralValue = 1;
break;
}
isUnique = m_switchLiteralSetPerScope.top().insert(mpCaseLiteralValue).second;
return isUnique;
}
void ProtoConverter::visit(Literal const& _x)
string ProtoConverter::visit(Literal const& _x)
{
switch (_x.literal_oneof_case())
{
case Literal::kIntval:
m_output << _x.intval();
break;
return to_string(_x.intval());
case Literal::kHexval:
m_output << "0x" << createHex(_x.hexval());
break;
return "0x" + createHex(_x.hexval());
case Literal::kStrval:
m_output << "\"" << createAlphaNum(_x.strval()) << "\"";
break;
return "\"" + createAlphaNum(_x.strval()) + "\"";
case Literal::LITERAL_ONEOF_NOT_SET:
m_output << "1";
break;
return dictionaryToken();
}
}
@ -116,7 +99,7 @@ void ProtoConverter::visit(Expression const& _x)
visit(_x.varref());
break;
case Expression::kCons:
visit(_x.cons());
m_output << visit(_x.cons());
break;
case Expression::kBinop:
visit(_x.binop());
@ -134,7 +117,7 @@ void ProtoConverter::visit(Expression const& _x)
visit(_x.func_expr());
break;
case Expression::EXPR_ONEOF_NOT_SET:
m_output << "1";
m_output << dictionaryToken();
break;
}
}
@ -693,12 +676,64 @@ void ProtoConverter::visit(BoundedForStmt const& _x)
void ProtoConverter::visit(CaseStmt const& _x)
{
// Silently ignore duplicate case literals
if (isCaseLiteralUnique(_x.case_lit()))
string literal = visit(_x.case_lit());
// u256 value of literal
u256 literalVal;
// Convert string to u256 before looking for duplicate case literals
if (_x.case_lit().has_strval())
{
m_output << "case ";
visit(_x.case_lit());
m_output << " ";
// Since string literals returned by the Literal visitor are enclosed within
// double quotes (like this "\"<string>\""), their size is at least two in the worst case
// that <string> is empty. Here we assert this invariant.
yulAssert(literal.size() >= 2, "Proto fuzzer: String literal too short");
// This variable stores the <string> part i.e., literal minus the first and last
// double quote characters. This is used to compute the keccak256 hash of the
// string literal. The hashing is done to check whether we are about to create
// a case statement containing a case literal that has already been used in a
// previous case statement. If the hash (u256 value) matches a previous hash,
// then we simply don't create a new case statement.
string noDoubleQuoteStr = "";
if (literal.size() > 2)
{
// Ensure that all characters in the string literal except the first
// and the last (double quote characters) are alphanumeric.
yulAssert(
boost::algorithm::all_of(literal.begin() + 1, literal.end() - 2, [=](char c) -> bool {
return std::isalpha(c) || std::isdigit(c);
}),
"Proto fuzzer: Invalid string literal encountered"
);
// Make a copy because literal will need to be used later
noDoubleQuoteStr = literal.substr(1, literal.size() - 2);
}
// Hash the result to check for duplicate case literal strings
literalVal = u256(h256(noDoubleQuoteStr, h256::FromBinary, h256::AlignLeft));
// Make sure that an empty string literal evaluates to zero. This is to detect creation of
// duplicate case literals like so
// switch (x)
// {
// case "": { x := 0 }
// case 0: { x:= 1 } // Case statement with duplicate literal is invalid
// } // This snippet will not be parsed successfully.
if (noDoubleQuoteStr.empty())
yulAssert(literalVal == 0, "Proto fuzzer: Empty string does not evaluate to zero");
}
else
literalVal = u256(literal);
// Check if set insertion fails (case literal present) or succeeds (case literal
// absent).
bool isUnique = m_switchLiteralSetPerScope.top().insert(literalVal).second;
// It is fine to bail out if we encounter a duplicate case literal because
// we can be assured that the switch statement is well-formed i.e., contains
// at least one case statement or a default block.
if (isUnique)
{
m_output << "case " << literal << " ";
visit(_x.case_block());
}
}
@ -965,6 +1000,9 @@ void ProtoConverter::visit(FunctionDefinition const& _x)
void ProtoConverter::visit(Program const& _x)
{
// Initialize input size
m_inputSize = _x.ByteSizeLong();
/* Program template is as follows
* Four Globals a_0, a_1, a_2, and a_3 to hold up to four function return values
*

View File

@ -46,6 +46,8 @@ public:
m_inForBodyScope = false;
m_inForInitScope = false;
m_numNestedForLoops = 0;
m_counter = 0;
m_inputSize = 0;
}
ProtoConverter(ProtoConverter const&) = delete;
ProtoConverter(ProtoConverter&&) = delete;
@ -55,7 +57,7 @@ private:
void visit(BinaryOp const&);
void visit(Block const&);
void visit(SpecialBlock const&);
void visit(Literal const&);
std::string visit(Literal const&);
void visit(VarRef const&);
void visit(Expression const&);
void visit(VarDecl const&);
@ -89,13 +91,13 @@ private:
void visit(FunctionDefinitionSingleReturnVal const&);
void visit(FunctionDefinitionMultiReturnVal const&);
void visit(Program const&);
template <class T>
void visit(google::protobuf::RepeatedPtrField<T> const& _repeated_field);
void registerFunction(FunctionDefinition const&);
std::string createHex(std::string const& _hexBytes) const;
std::string createAlphaNum(std::string const& _strBytes) const;
bool isCaseLiteralUnique(Literal const&);
std::string createHex(std::string const& _hexBytes);
/// Accepts an arbitrary string, removes all characters that are neither
/// alphabets nor digits from it and returns the said string.
std::string createAlphaNum(std::string const& _strBytes);
enum class NumFunctionReturns
{
None,
@ -127,6 +129,20 @@ private:
break;
}
}
/// Returns a pseudo-random dictionary token.
/// @param _p Enum that decides if the returned token is hex prefixed ("0x") or not
/// @return Dictionary token at the index computed using a
/// monotonically increasing counter as follows:
/// index = (m_inputSize * m_inputSize + counter) % dictionarySize
/// where m_inputSize is the size of the protobuf input and
/// dictionarySize is the total number of entries in the dictionary.
std::string dictionaryToken(dev::HexPrefix _p = dev::HexPrefix::Add);
/// Returns a monotonically increasing counter that starts from zero.
unsigned counter()
{
return m_counter++;
}
std::ostringstream m_output;
// Number of live variables in inner scope of a function
@ -151,6 +167,10 @@ private:
unsigned m_numNestedForLoops;
// predicate to keep track of for loop init scope
bool m_inForInitScope;
/// Monotonically increasing counter
unsigned m_counter;
/// Size of protobuf input
unsigned m_inputSize;
};
}
}

View File

@ -0,0 +1,777 @@
static const std::vector<std::string> hexDictionary = {
"0",
"1",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1f",
"9f",
"a0",
"a1",
"ff",
"100",
"101",
"10",
"100",
"1000",
"10000",
"100000",
"1000000",
"10000000",
"100000000",
"1000000000",
"10000000000",
"100000000000",
"1000000000000",
"10000000000000",
"100000000000000",
"1000000000000000",
"10000000000000000",
"100000000000000000",
"1000000000000000000",
"10000000000000000000",
"100000000000000000000",
"1000000000000000000000",
"10000000000000000000000",
"100000000000000000000000",
"1000000000000000000000000",
"10000000000000000000000000",
"100000000000000000000000000",
"1000000000000000000000000000",
"10000000000000000000000000000",
"100000000000000000000000000000",
"1000000000000000000000000000000",
"10000000000000000000000000000000",
"100000000000000000000000000000000",
"1000000000000000000000000000000000",
"10000000000000000000000000000000000",
"100000000000000000000000000000000000",
"1000000000000000000000000000000000000",
"10000000000000000000000000000000000000",
"100000000000000000000000000000000000000",
"1000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000000000000",
"10000000000000000000000000000000000000000000000000000000000000",
"100000000000000000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000000000000000",
"1000000000000000000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000000001",
"10000000000000000000000000000000000000000001",
"1000000000000000000000000000000000000000001",
"100000000000000000000000000000000000000001",
"10000000000000000000000000000000000000001",
"1000000000000000000000000000000000000001",
"100000000000000000000000000000000000001",
"10000000000000000000000000000000000001",
"1000000000000000000000000000000000001",
"100000000000000000000000000000000001",
"10000000000000000000000000000000001",
"1000000000000000000000000000000001",
"100000000000000000000000000000001",
"10000000000000000000000000000001",
"1000000000000000000000000000001",
"100000000000000000000000000001",
"10000000000000000000000000001",
"1000000000000000000000000001",
"100000000000000000000000001",
"10000000000000000000000001",
"1000000000000000000000001",
"100000000000000000000001",
"10000000000000000000001",
"1000000000000000000001",
"100000000000000000001",
"10000000000000000001",
"1000000000000000001",
"100000000000000001",
"10000000000000001",
"1000000000000001",
"100000000000001",
"10000000000001",
"1000000000001",
"100000000001",
"10000000001",
"1000000001",
"100000001",
"10000001",
"1000001",
"100001",
"10001",
"1001",
"101",
"11",
"1f",
"1ff",
"1fff",
"1ffff",
"1fffff",
"1ffffff",
"1fffffff",
"1ffffffff",
"1fffffffff",
"1ffffffffff",
"1fffffffffff",
"1ffffffffffff",
"1fffffffffffff",
"1ffffffffffffff",
"1fffffffffffffff",
"1ffffffffffffffff",
"1fffffffffffffffff",
"1ffffffffffffffffff",
"1fffffffffffffffffff",
"1ffffffffffffffffffff",
"1fffffffffffffffffffff",
"1ffffffffffffffffffffff",
"1fffffffffffffffffffffff",
"1ffffffffffffffffffffffff",
"1fffffffffffffffffffffffff",
"1ffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"2",
"20",
"200",
"2000",
"20000",
"200000",
"2000000",
"20000000",
"200000000",
"2000000000",
"20000000000",
"200000000000",
"2000000000000",
"20000000000000",
"200000000000000",
"2000000000000000",
"20000000000000000",
"200000000000000000",
"2000000000000000000",
"20000000000000000000",
"200000000000000000000",
"2000000000000000000000",
"20000000000000000000000",
"200000000000000000000000",
"2000000000000000000000000",
"20000000000000000000000000",
"200000000000000000000000000",
"2000000000000000000000000000",
"20000000000000000000000000000",
"200000000000000000000000000000",
"2000000000000000000000000000000",
"20000000000000000000000000000000",
"200000000000000000000000000000000",
"2000000000000000000000000000000000",
"20000000000000000000000000000000000",
"200000000000000000000000000000000000",
"2000000000000000000000000000000000000",
"20000000000000000000000000000000000000",
"200000000000000000000000000000000000000",
"2000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000000000000",
"20000000000000000000000000000000000000000000000000000000000000",
"200000000000000000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000000000000000",
"2000000000000000000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000000001",
"20000000000000000000000000000000000000000001",
"2000000000000000000000000000000000000000001",
"200000000000000000000000000000000000000001",
"20000000000000000000000000000000000000001",
"2000000000000000000000000000000000000001",
"200000000000000000000000000000000000001",
"20000000000000000000000000000000000001",
"2000000000000000000000000000000000001",
"200000000000000000000000000000000001",
"20000000000000000000000000000000001",
"2000000000000000000000000000000001",
"200000000000000000000000000000001",
"20000000000000000000000000000001",
"2000000000000000000000000000001",
"200000000000000000000000000001",
"20000000000000000000000000001",
"2000000000000000000000000001",
"200000000000000000000000001",
"20000000000000000000000001",
"2000000000000000000000001",
"200000000000000000000001",
"20000000000000000000001",
"2000000000000000000001",
"200000000000000000001",
"20000000000000000001",
"2000000000000000001",
"200000000000000001",
"20000000000000001",
"2000000000000001",
"200000000000001",
"20000000000001",
"2000000000001",
"200000000001",
"20000000001",
"2000000001",
"200000001",
"20000001",
"2000001",
"200001",
"20001",
"2001",
"201",
"21",
"3",
"3f",
"3ff",
"3fff",
"3ffff",
"3fffff",
"3ffffff",
"3fffffff",
"3ffffffff",
"3fffffffff",
"3ffffffffff",
"3fffffffffff",
"3ffffffffffff",
"3fffffffffffff",
"3ffffffffffffff",
"3fffffffffffffff",
"3ffffffffffffffff",
"3fffffffffffffffff",
"3ffffffffffffffffff",
"3fffffffffffffffffff",
"3ffffffffffffffffffff",
"3fffffffffffffffffffff",
"3ffffffffffffffffffffff",
"3fffffffffffffffffffffff",
"3ffffffffffffffffffffffff",
"3fffffffffffffffffffffffff",
"3ffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"4",
"40",
"400",
"4000",
"40000",
"400000",
"4000000",
"40000000",
"400000000",
"4000000000",
"40000000000",
"400000000000",
"4000000000000",
"40000000000000",
"400000000000000",
"4000000000000000",
"40000000000000000",
"400000000000000000",
"4000000000000000000",
"40000000000000000000",
"400000000000000000000",
"4000000000000000000000",
"40000000000000000000000",
"400000000000000000000000",
"4000000000000000000000000",
"40000000000000000000000000",
"400000000000000000000000000",
"4000000000000000000000000000",
"40000000000000000000000000000",
"400000000000000000000000000000",
"4000000000000000000000000000000",
"40000000000000000000000000000000",
"400000000000000000000000000000000",
"4000000000000000000000000000000000",
"40000000000000000000000000000000000",
"400000000000000000000000000000000000",
"4000000000000000000000000000000000000",
"40000000000000000000000000000000000000",
"400000000000000000000000000000000000000",
"4000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000000000000",
"40000000000000000000000000000000000000000000000000000000000000",
"400000000000000000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000000000000000",
"4000000000000000000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000000001",
"40000000000000000000000000000000000000000001",
"4000000000000000000000000000000000000000001",
"400000000000000000000000000000000000000001",
"40000000000000000000000000000000000000001",
"4000000000000000000000000000000000000001",
"400000000000000000000000000000000000001",
"40000000000000000000000000000000000001",
"4000000000000000000000000000000000001",
"400000000000000000000000000000000001",
"40000000000000000000000000000000001",
"4000000000000000000000000000000001",
"400000000000000000000000000000001",
"40000000000000000000000000000001",
"4000000000000000000000000000001",
"400000000000000000000000000001",
"40000000000000000000000000001",
"4000000000000000000000000001",
"400000000000000000000000001",
"40000000000000000000000001",
"4000000000000000000000001",
"400000000000000000000001",
"40000000000000000000001",
"4000000000000000000001",
"400000000000000000001",
"40000000000000000001",
"4000000000000000001",
"400000000000000001",
"40000000000000001",
"4000000000000001",
"400000000000001",
"40000000000001",
"4000000000001",
"400000000001",
"40000000001",
"4000000001",
"400000001",
"40000001",
"4000001",
"400001",
"40001",
"4001",
"401",
"41",
"5",
"7",
"7f",
"7ff",
"7fff",
"7ffff",
"7fffff",
"7ffffff",
"7fffffff",
"7ffffffff",
"7fffffffff",
"7ffffffffff",
"7fffffffffff",
"7ffffffffffff",
"7fffffffffffff",
"7ffffffffffffff",
"7fffffffffffffff",
"7ffffffffffffffff",
"7fffffffffffffffff",
"7ffffffffffffffffff",
"7fffffffffffffffffff",
"7ffffffffffffffffffff",
"7fffffffffffffffffffff",
"7ffffffffffffffffffffff",
"7fffffffffffffffffffffff",
"7ffffffffffffffffffffffff",
"7fffffffffffffffffffffffff",
"7ffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"8",
"80",
"800",
"8000",
"80000",
"800000",
"8000000",
"80000000",
"800000000",
"8000000000",
"80000000000",
"800000000000",
"8000000000000",
"80000000000000",
"800000000000000",
"8000000000000000",
"80000000000000000",
"800000000000000000",
"8000000000000000000",
"80000000000000000000",
"800000000000000000000",
"8000000000000000000000",
"80000000000000000000000",
"800000000000000000000000",
"8000000000000000000000000",
"80000000000000000000000000",
"800000000000000000000000000",
"8000000000000000000000000000",
"80000000000000000000000000000",
"800000000000000000000000000000",
"8000000000000000000000000000000",
"80000000000000000000000000000000",
"800000000000000000000000000000000",
"8000000000000000000000000000000000",
"80000000000000000000000000000000000",
"800000000000000000000000000000000000",
"8000000000000000000000000000000000000",
"80000000000000000000000000000000000000",
"800000000000000000000000000000000000000",
"8000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000000000000",
"80000000000000000000000000000000000000000000000000000000000000",
"800000000000000000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000000000000000",
"8000000000000000000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000000001",
"80000000000000000000000000000000000000000001",
"8000000000000000000000000000000000000000001",
"800000000000000000000000000000000000000001",
"80000000000000000000000000000000000000001",
"8000000000000000000000000000000000000001",
"800000000000000000000000000000000000001",
"80000000000000000000000000000000000001",
"8000000000000000000000000000000000001",
"800000000000000000000000000000000001",
"80000000000000000000000000000000001",
"8000000000000000000000000000000001",
"800000000000000000000000000000001",
"80000000000000000000000000000001",
"8000000000000000000000000000001",
"800000000000000000000000000001",
"80000000000000000000000000001",
"8000000000000000000000000001",
"800000000000000000000000001",
"80000000000000000000000001",
"8000000000000000000000001",
"800000000000000000000001",
"80000000000000000000001",
"8000000000000000000001",
"800000000000000000001",
"80000000000000000001",
"8000000000000000001",
"800000000000000001",
"80000000000000001",
"8000000000000001",
"800000000000001",
"80000000000001",
"8000000000001",
"800000000001",
"80000000001",
"8000000001",
"800000001",
"80000001",
"8000001",
"800001",
"80001",
"8001",
"801",
"81",
"9",
"f",
"ff",
"fff",
"ffff",
"fffff",
"ffffff",
"fffffff",
"ffffffff",
"fffffffff",
"ffffffffff",
"fffffffffff",
"ffffffffffff",
"fffffffffffff",
"ffffffffffffff",
"fffffffffffffff",
"ffffffffffffffff",
"fffffffffffffffff",
"ffffffffffffffffff",
"fffffffffffffffffff",
"ffffffffffffffffffff",
"fffffffffffffffffffff",
"ffffffffffffffffffffff",
"fffffffffffffffffffffff",
"ffffffffffffffffffffffff",
"fffffffffffffffffffffffff",
"ffffffffffffffffffffffffff",
"fffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
};