#include <bits/stdc++.h>
using namespace std;
bool checkBit(int n, int pos) { return (n & (1 << pos)); }
int setBit(int n, int pos) { return (n | (1 << pos)); }
const int MAX = 300005;
int n, m, arr[MAX], tree[MAX];
pair<int, int> ans[MAX];
int lastAppearance[MAX];
struct queryListType {
  int val, l, r;
};
vector<queryListType> queryList[MAX];
vector<int> appearanceList[MAX];
namespace fenwick {
int treeLim;
void init(int _treeLim) {
  memset(tree, 0, sizeof(tree));
  treeLim = _treeLim;
}
void update(int idx, int val) {
  while (idx <= treeLim) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
int query(int idx) {
  int sum = 0;
  while (idx > 0) {
    sum += tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
int query(int l, int r) { return query(r) - query(l - 1); }
void updateSet(int idx) {
  if (query(idx, idx) == 0) {
    update(idx, 1);
  }
}
}  // namespace fenwick
void resolveQueries() {
  fenwick::init(m);
  memset(lastAppearance, -1, sizeof(lastAppearance));
  for (int i = 1; i <= m; i++) {
    if (lastAppearance[arr[i]] != -1) {
      fenwick::update(lastAppearance[arr[i]], -1);
    }
    lastAppearance[arr[i]] = i;
    fenwick::update(i, +1);
    for (auto &query : queryList[i]) {
      int uniqueElements = fenwick::query(query.l, query.r);
      ans[query.val].second = max(ans[query.val].second, uniqueElements + 1);
    }
  }
}
void handleGreaterUnique(int val) {
  int greaterUnique = fenwick::query(val + 1, n);
  ans[val].second = max(ans[val].second, greaterUnique + val);
}
void resolveFirstAppearances() {
  fenwick::init(n);
  for (int i = 1; i <= m; i++) {
    if (appearanceList[arr[i]][0] == i) {
      handleGreaterUnique(arr[i]);
    }
    fenwick::updateSet(arr[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (appearanceList[i].empty()) {
      handleGreaterUnique(i);
    }
  }
}
void solve() {
  for (int i = 1; i <= m; i++) {
    appearanceList[arr[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    ans[i].second = i;
    if (appearanceList[i].empty()) {
      ans[i].first = i;
      continue;
    }
    ans[i].first = 1;
    if ((int)appearanceList[i].size() > 1) {
      for (int j = 1; j < (int)appearanceList[i].size(); j++) {
        if (appearanceList[i][j - 1] + 1 <= appearanceList[i][j] - 1) {
          queryList[appearanceList[i][j] - 1].push_back(
              {i, appearanceList[i][j - 1] + 1, appearanceList[i][j] - 1});
        }
      }
    }
    if (appearanceList[i].back() + 1 <= m) {
      queryList[m].push_back({i, appearanceList[i].back() + 1, m});
    }
  }
  resolveFirstAppearances();
  resolveQueries();
  for (int i = 1; i <= n; i++) {
    printf("%d %d\n", ans[i].first, ans[i].second);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &arr[i]);
  }
  solve();
  return 0;
}
