#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    if (!(cin >> n)) return 0; // Safe check for input

    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }

    int k;
    cin >> k;

    // Use a vector of pairs for cleaner syntax and better performance
    vector<pair<int, int>> ans;

    for (int i = 0; i < n; i++) {
        // j <= i + k already guarantees the distance is <= k
        for (int j = i + 1; j < n && j <= i + k; j++) {
            if (arr[i] == arr[j]) {
                cout << "Yes we found the valid pair" << endl;
                ans.push_back({i, j});
            }
        }
    }
    
    // Printing out the discovered pairs
    for (const auto& p : ans) {
        cout << p.first << " : " << p.second << endl;
    }

    return 0;
}