#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

vector<int> v;

int main() {
    int n;
    string s;
    cin >> n >> s;

    int len = size(s);
    rep(i, len){
        FOR(j, i + 1, len){
            if(s[i] == s[j]){
                continue;
            }

            FOR(k, j + 1, len){
                if(s[i] == s[k] || s[j] == s[k]){
                    continue;
                }

                int ji = j - i;
                int kj = k - j;
                if(ji == kj){
                    continue;
                }

                cout << (i + 1) << sp << (j + 1) << sp << (k + 1) << next;
            }
        }
    }
}
