#include <bits/stdc++.h>
using namespace std;
int n, k;
int b[100055];
struct node {
  int val;
  int lazy;
  node *left, *right;
  node(int val) : val(val) {
    left = right = NULL;
    lazy = 0;
  };
} * root;
int lg[100055];
int dat[17][100055];
inline int rmq_b(int l, int r) {
  int level = lg[r - l + 1];
  return min(dat[level][l], dat[level][r - (1 << level) + 1]);
}
inline void push(node *u) {
  if (u->lazy) {
    u->left->val = u->left->lazy = u->lazy;
    u->right->val = u->right->lazy = u->lazy;
    u->lazy = 0;
  }
}
void update(node *u, int x, int y, int l, int r, int val) {
  if (l > y || r < x) return;
  if (l <= x && y <= r) {
    u->val = val;
    u->lazy = val;
    return;
  }
  int mid = (x + y) >> 1;
  if (!u->left) {
    int p = x % n, q = mid % n;
    int val;
    if (mid - x + 1 >= n)
      val = rmq_b(0, n - 1);
    else if (p <= q)
      val = rmq_b(p, q);
    else
      val = min(rmq_b(0, q), rmq_b(p, n - 1));
    u->left = new node(val);
  }
  if (!u->right) {
    int p = (mid + 1) % n, q = y % n;
    int val;
    if (mid - x + 1 >= n)
      val = rmq_b(0, n - 1);
    else if (p <= q)
      val = rmq_b(p, q);
    else
      val = min(rmq_b(0, q), rmq_b(p, n - 1));
    u->right = new node(val);
  }
  push(u);
  update(u->left, x, mid, l, r, val);
  update(u->right, mid + 1, y, l, r, val);
  u->val = min(u->left->val, u->right->val);
}
int query(node *u, int x, int y, int l, int r) {
  if (l > y || r < x) return 0x3f3f3f3f;
  if (l <= x && y <= r) {
    return u->val;
  }
  int mid = (x + y) >> 1;
  if (!u->left) {
    int p = x % n, q = mid % n;
    int val;
    if (mid - x + 1 >= n)
      val = rmq_b(0, n - 1);
    else if (p <= q)
      val = rmq_b(p, q);
    else
      val = min(rmq_b(0, q), rmq_b(p, n - 1));
    u->left = new node(val);
  }
  if (!u->right) {
    int p = (mid + 1) % n, q = y % n;
    int val;
    if (mid - x + 1 >= n)
      val = rmq_b(0, n - 1);
    else if (p <= q)
      val = rmq_b(p, q);
    else
      val = min(rmq_b(0, q), rmq_b(p, n - 1));
    u->right = new node(val);
  }
  push(u);
  return min(query(u->left, x, mid, l, r), query(u->right, mid + 1, y, l, r));
}
int main() {
  scanf("%d %d", &n, &k);
  memset(dat, 63, sizeof(dat));
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    dat[0][i] = b[i];
  }
  for (int i = 2; i <= n; i++) {
    lg[i] = lg[i >> 1] + 1;
  }
  for (int i = 0; i + 1 < 17; i++)
    for (int j = 0; j + (1 << i) < n; j++) {
      dat[i + 1][j] = min(dat[i][j], dat[i][j + (1 << i)]);
    }
  root = new node(rmq_b(0, n - 1));
  int q;
  scanf("%d", &q);
  while (q--) {
    int ope, x, y, z;
    scanf("%d %d %d", &ope, &x, &y);
    x--, y--;
    if (ope == 1) {
      scanf("%d", &z);
      update(root, 0, n * k - 1, x, y, z);
    } else {
      printf("%d\n", query(root, 0, n * k - 1, x, y));
    }
  }
  return 0;
}
