#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    int n;
    cin >> n;
    vector<vector<int>> v(n);
    int j = 1;
    bool b = 1;
    while (j <= n * n) {
      if (b) {
        for (int i = 0; i < n; ++i) {
          v[i].push_back(j);
          j++;
          b = 0;
        }
      } else {
        for (int i = n - 1; i >= 0; i--) {
          v[i].push_back(j);
          j++;
          b = 1;
        }
      }
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        cout << v[i][j] << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}
