document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include<bits/stdc++.h>
  2. const int SIZE = 200 * 1000 + 1;
  3. int N,c[SIZE];
  4. int change(){
  5.     for(int i=1;i<N-1;i++){
  6.         if(c[i+1]<=0){
  7.             for(int j=i;j<=N;j++){
  8.                 if((i-j)%2==0)c[j]--;
  9.                 else c[j]++;
  10.             }
  11.             return i;
  12.         }
  13.     }
  14.     if(c[N]<0){
  15.         c[N-1]--;
  16.         c[N]++;
  17.         return N-1;
  18.     }
  19.     if(c[N]>0){
  20.         c[N]--;
  21.         return N;
  22.     }
  23.     return -1;
  24. }
  25. int main(){
  26.     scanf("%d",&N);
  27.     for(int i=1;i<=N;i++){
  28.         scanf("%d",&c[i]);
  29.         c[i]=c[i]*2-c[i-1];
  30.     }
  31.     int s=change();
  32.     int t=change();
  33.     int z=change();
  34.     if(z!=-1)return 0*puts("Impossible");
  35.     if(s==-1){s=N-1,t=N;c[N-1]--;}
  36.     printf("%d\\n",s);
  37.     while(s!=1){
  38.         s--;
  39.         c[s]--;
  40.         printf("<");
  41.     }
  42.     while(s<t){
  43.         printf(">");
  44.         c[s]--;
  45.         while(c[s]>0){
  46.             printf("<>");
  47.             c[s]-=2;
  48.         }
  49.         s++;
  50.     }
  51.     while(s<N){
  52.         c[s]--;
  53.         printf(">");
  54.         s++;
  55.     }
  56.     while(s>t){
  57.         s--;
  58.         if(!c[s])break;
  59.         printf("<");
  60.         c[s]--;
  61.         while(c[s]>0){
  62.             printf("><");
  63.             c[s]-=2;
  64.         }
  65.     }
  66. }
');