#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 100000010000;
long long kai[100010];
long long a[300010];
long long n, m;
long long bit[600010];
long long order[300010];
long long lar[300010];
map<long long, long long> mp;
long long sum(long long i) {
  long long s = 0;
  while (i > 0) {
    s += bit[i];
    i -= i & -i;
  }
  return s;
}
void add(long long i, long long x) {
  while (i <= 600005) {
    bit[i] += x;
    i += i & -i;
  }
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long pow_mod(long long x, long long y) {
  if (y == 0) return 1;
  if (y % 2 == 1) {
    return x * pow_mod(x, y - 1) % mod;
  } else {
    long long half = pow_mod(x, y / 2);
    return half * half % mod;
  }
}
long long div_mod(long long x) { return pow_mod(x, mod - 2); }
long long com(long long x, long long y) {
  return kai[x] * div_mod(kai[y] * kai[x - y] % mod) % mod;
}
void init() {
  cin >> n >> m;
  for (int i = m; i >= 1; i--) {
    cin >> a[i];
    mp[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    lar[i] = i;
  }
}
void output() {}
void solve() {
  for (int i = 1; i <= n; i++) {
    add(i + m, 1);
    order[i] = i + m;
  }
  for (int i = m; i >= 1; i--) {
    lar[a[i]] = max(lar[a[i]], sum(order[a[i]]));
    add(order[a[i]], -1);
    add(i, 1);
    order[a[i]] = i;
  }
  long long kind = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    kind++;
  }
  for (int i = 1; i <= n; i++) {
    lar[i] = max(lar[i], sum(order[i]));
    if (mp[i] == 0) {
      cout << i << ' ' << lar[i] << endl;
    } else {
      cout << 1 << ' ' << lar[i] << endl;
    }
  }
}
int main() {
  init();
  solve();
  output();
  long long N;
  cin >> N;
}
