//include //ciso646,ccomplex,cstdbool,ctgmath are deleted by compile error. //instead, I use complex and cmath. // C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @file stdc++.h * This is an implementation file for a precompiled header. */ // 17.4.1.2 Headers // C # ifndef _GLIBCXX_NO_ASSERT # include # endif # include # include # include # include # include # include # include # include # include # include # include # include # include # include # if __cplusplus >= 201103L # include # include # include # include # include # endif // C++ # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # if __cplusplus >= 201103L # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include #include #include # endif //pragma #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //define #define pb push_back #define pob pop_back #define umap unordered_map #define uset unordered_set #define pq priority_queue #define Yes cout << "Yes" << endl #define No cout << "No" << endl #define YES cout << "YES" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define srep(i, s, n) for (int i = s; i < (int)(n); i++) #define rrep(i,n) for (int i=(int)(n); 0<=i; i--) #define spe <<" "<< //space #define sei fixed< using vc = vector; template using vv = vc>; using bl = bool; using vl = vc; using vvl = vv; //Frest様より using vs = vc; using vvs = vv; using vb = vc; using vvb = vv; using vld = vc; using vvld = vv; templateistream& operator>>(istream& i, vc& v) { rep(j, size(v))i >> v[j]; return i; } //変数 ll INF=1LL<<60; //ll mint=998244353; ll mint=1000000007; //多倍長整数 @tubo28様のQiita記事より #include namespace mp = boost::multiprecision; using Bint = mp::cpp_int; using Real = mp::number>; //@gis様のQiita記事より class Rand { private: //32ビット版メルセンヌ・ツイスタ std::mt19937 mt; //非決定論的な乱数 std::random_device rd; public: //コンストラクタ(初期化) Rand() { mt.seed(rd()); } //初期値 void seed() { mt.seed(rd()); } void seed(const std::uint_fast32_t seed_) { mt.seed(seed_); } //通常の乱数 std::uint_fast32_t operator()() { return mt(); } //0~最大値-1 (余りの範囲の一様分布乱数) std::int_fast32_t operator()(const std::int_fast32_t max_) { std::uniform_int_distribution<> uid(0, ((max_ > 0) ? (std::int_fast32_t)max_ - 1 : 0)); return uid(mt); } //最小値~最大値 std::int_fast32_t operator()(const std::int_fast32_t min_, const std::int_fast32_t max_) { std::uniform_int_distribution<> uid((min_ <= max_) ? min_ : max_, (min_ <= max_) ? max_ : min_); return uid(mt); } //確率 bool randBool(const double probability_) { std::bernoulli_distribution uid(probability_); return uid(mt); } bool randBool() { std::uniform_int_distribution<> uid(0, 1); return ((uid(mt)) ? true : false); } }; static thread_local Rand rnd; //AHC用タイマー Frest様より class TimeKeeper { private: std::chrono::high_resolution_clock::time_point start_time_; int64_t time_threshold_; public: // 時間制限をミリ秒単位で指定してインスタンスをつくる。 1秒(s)=1000ms TimeKeeper(const int64_t& time_threshold) : start_time_(std::chrono::high_resolution_clock::now()), time_threshold_(time_threshold) { } // インスタンス生成した時から指定した時間制限を超過したか判定する。 bool isTimeOver() const { auto diff = std::chrono::high_resolution_clock::now() - this->start_time_; return std::chrono::duration_cast(diff).count() >= time_threshold_; } double get_time() {//経過時間を返す auto diff = std::chrono::high_resolution_clock::now() - this->start_time_; return std::chrono::duration_cast(diff).count(); } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); srand((unsigned)time(NULL)); //e869120様のQiita記事より TimeKeeper tk(1980); char c,d;cin>>c>>d; ll n;cin>>n; if (n==1 && (c != d)) cout << -1 << endl; else { if (c == d && n == 1){ cout << c << endl; } cout << c; rep(i,n-2){ cout << "a"; } cout << d << endl; } }