#include <iomanip>
#include <iostream>
#include <vector>
#include <cmath>
#include <thread>
#include <chrono>
#include <atomic>
using namespace std;
typedef unsigned long long ull;
#define DBG(x) { cout << left << setw(30) << #x << (x) << endl; }
template <int N>
struct Silnia{
enum { value = N * Silnia<N-1>::value };
};
template <>
struct Silnia<0>{
enum { value = 1 };
};
template<char c>
struct adjust_ascii{
static constexpr int value = c - '0';
};
constexpr ull power(ull base, ull exp){
return exp ? power(base,exp-1) * base : 1;
}
template<ull First, ull... Others>
struct to_val{
static constexpr ull exec(){
return First*power(10,sizeof...(Others)) + to_val<Others...>::exec();
}
};
template<ull Last>
struct to_val<Last>{
static constexpr ull exec(){
return Last;
}
};
template <char... Cs>
constexpr ull operator"" _silnia(){
return Silnia<to_val<adjust_ascii<Cs>::value...>::exec()>::value;
}
auto main() -> int
{
DBG(1_silnia);
DBG(2_silnia);
DBG(3_silnia);
DBG(4_silnia);
DBG(5_silnia);
DBG(6_silnia);
DBG(7_silnia);
DBG(8_silnia);
DBG(9_silnia);
DBG(10_silnia);
DBG(11_silnia);
DBG(12_silnia);
}
I2luY2x1ZGUgPGlvbWFuaXA+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8dGhyZWFkPgojaW5jbHVkZSA8Y2hyb25vPgojaW5jbHVkZSA8YXRvbWljPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnR5cGVkZWYgdW5zaWduZWQgbG9uZyBsb25nIHVsbDsKCiNkZWZpbmUgREJHKHgpIHsgY291dCA8PCBsZWZ0IDw8IHNldHcoMzApIDw8ICN4IDw8ICh4KSA8PCBlbmRsOyB9Cgp0ZW1wbGF0ZSA8aW50IE4+CnN0cnVjdCBTaWxuaWF7CgllbnVtIHsgdmFsdWUgPSBOICogU2lsbmlhPE4tMT46OnZhbHVlIH07Cn07Cgp0ZW1wbGF0ZSA8PgpzdHJ1Y3QgU2lsbmlh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