#include<bits/stdc++.h>
 
using namespace std;
 
void output(vector<int> &a){
  cout << a.size();
  for(auto &nx : a){
    cout << ' ' << nx;
  }
  cout << '\n';
}
 
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(auto &nx : a){cin >> nx;}
  vector<vector<int>> bk(200,vector<int>(0));
  int cnt=min(n,8);
  for(int i=1;i<(1<<cnt);i++){
    int sig=0;
    vector<int> s;
    for(int j=0;j<cnt;j++){
      if(i&(1<<j)){
        s.push_back(j+1);
        sig+=a[j];sig%=200;
      }
    }
    if(bk[sig].size()!=0){
      cout << "Yes\n";
      output(bk[sig]);
      output(s);
      return 0;
    }
    else{bk[sig]=s;}
  }
  cout << "No\n";
  return 0;
}
/*
    author:ujwalll
*/
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define nx cout << "\n";
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
#define pp pair<ll, ll>
#define ppi pair<int, int>
typedef long long int ll;
#define pri(x) printf("%d ", x);
#define prl(x) printf("%lld ", x);
#define fi first;
#define se second;
#define pb push_back;
#define all(v) v.begin(), v.end()
#define minimum 1
#define maximum 1e5 
#define random minimum + (rand() % static_cast<int>(maximum - minimum + 1))

bool isPowerOfTwo(ll x){
    return x && (!(x & (x - 1)));
}
void fastio(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}
long long binpow(long long a, long long b){
    long long res = 1;
    while (b > 0)
    {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
// int dfstimer(int node, int par){
//     st[node]=timer;
//     ft[timer]=node;
//     timer++;
//     for(auto i:adj[node]){
//         if(i!=par)dfs(i,node);
//     }
//     et[node]=timer;
//     ft[timer]=node;
//     timer++;
// }
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
////////////////////////////////////////////////////////////////////
map<int,char> mp;
int main(){
    fastio();
    int tc = 1;
    // cin>>tc;
    while(tc--){
        int n;
        cin>>n;
        string s;
        cin>>s;
        int q;
        cin>>q;
        rep(i,2*n){
            mp[i]=s[i];
        }
        int bi = 0;
        while(q--){
            int t,a,b;
            cin>>t>>a>>b;
            if(t==2)bi^=1;
            else{
                a--;
                b--;
                if(bi){
                    if(a>=n)a-=n;
                    else a+=n;
                    if(b>=n)b-=n;
                    else b+=n;
                }
                    char c = mp[a];
                    mp[a]=mp[b];
                    mp[b]=c;                    
            }
        }
        for(auto i:mp){
            s[i.first]=i.second;
        }
        // cout<<bi;
        if(bi){
            string ans = "";
            for(int i=n;i<2*n;i++)ans+=s[i];
            rep(i,n)ans+=s[i];
            cout<<ans;
        }
        else cout<<s;
        done:;

    }
    return 0;
}