long long A,B,C,D,E,F, I,J,K, M,N,O,P,Q,R,S,T,U,V, X,Y,Z; //long long A,B,C,D,E,F, H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; #include #include using namespace std; typedef long long ll; #include #include #include #include #include #include #include //typedef pair P; //typedef pair P1; //typedef pair P2; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 //#define INF 100000000000000000//19桁 #define INF 1e18+5//19桁 #define mod 1000000007 #define fi first #define se second #define rep(i,x) for(long long i=0;i=0;i--) #define rrepn(i,x) for(long long i=x;i>1;i--) #define SORT(x) sort(x.begin(),x.end()) #define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end()) #define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) #define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) #define All(x) (x).begin(),(x).end() #define rAll(x) (x).rbegin(),(x).rend() #define ALL(v) (v).begin(),(v).end() //#define MAX(a,b) if(a>b) #define MAX(a,b) (((a)>(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b)) const string MINUSINF = "-"; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } void chmax(string &a, string b) { if (a == MINUSINF) a = b; else if (a.size() < b.size()) a = b; else if (a.size() == b.size()) { if (a < b) a = b; } } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define pr printf #define re return #define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0) int GCD(int a, int b) { return b ? GCD(b, a%b) : a; } stack sta; queue que; deque dque; set s_set; long long sum,sum1,sum2,sum3,sum4; long long flg,flg1,flg2,flg3,cnt,cnt1,cnt2,cnt3,cnt4; long long wk,wk1,wk2,wk3,wk4; long long ans; bool f; long long weight[110], value[110]; // 品物の個数は 100 個なので少し余裕持たせてサイズ 110 に ll a[100010][3]; // a[i], b[i], c[i] をそれぞれまとめて a[i][0], a[i][1], a[i][2] にしてしまう long long n,h[100005]; vector p, c; int vis[200001]; vector fi; int Left[2100][2100], Right[2100][2100], Up[2100][2100], Down[2100][2100]; long long match[10] = {2,5,5,4,5,6,3,7,6}; vector box; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); long long max,max1; long long min,min1; sum=sum1=sum2=sum3=sum4=0; flg=flg1=flg2=flg3=cnt=cnt1=cnt2=cnt3=cnt4=0; max=max1=0; wk=wk1=wk2=wk3=wk4=0; ans=0; min=min1=INF; //**************************こどふぉ用****************************************** /* std::vector v(100005); cin >> T; while(T--){ cin >> N >> K; vector last(N + 1, -INF); map M; //M.clear(); int ret=1<<20; for(int i=1;i<=N;i++){ } cout << N << "\n"; } */ //**************************ここからスタート****************************************** //std::cin >> N; //std::cin >> N >> M; //std::cin >> N >> M >> K; //std::cin >> N >> K; //std::cin >> A >> B; //std::cin >> A >> B >> C; //std::vector v(N); //std::vector w(N); //std::vector x(N); //std::vector v(100, 0); //int a[26]={0}; //vector flagment(N, 0); //vec.push_back(i); //accumulate(vec.begin(), vec.end(), 0) //v.resize // 配列入力1 /* for(long long i=0; i> v[i]; } */ //std::sort(v.begin(),v.end());//昇順ソート //std::sort(v.begin(),v.end(),std::greater());//降順ソート //通常 /* for(long long i=0; i> s; //sort(s.begin(), s.end()); for(long long i=0; i> s; vector vec; for (int i = 0; i < s.size(); ++i) { vec.push_back(s[i]); } //sort(vec.begin(), vec.end()); std::sort(vec.begin(),vec.end(),std::greater());//降順ソート for (int i = 0; i < s.size()-1; ++i) { if(vec[i]!=vec[i+1]){ flg=1; } } for (int i = 0; i < s.size()-1; ++i) { if(vec[i]!=0){ cnt++; } } if(vec[0]=='0' || vec[0+1]=='0' || s.size()<=1 || flg==0 || cnt<=1){ puts("-1"); return 0; } char wwk; wwk=vec[s.size()-1]; vec[s.size()-1]=vec[s.size()-2]; vec[s.size()-2]=wwk; for (int i = 0; i < s.size(); ++i) { pr("%c",vec[i]); } //cout << vec[K-1] << endl; return 0; }