#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000");
using namespace std;
const int MAX_ARRAY = 100005;
string num2str(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}
std::vector<std::string> split(std::string str, std::string pattern) {
  std::string::size_type pos;
  std::vector<std::string> result;
  str += pattern;
  int size = str.size();
  for (int i = 0; i < size; i++) {
    pos = str.find(pattern, i);
    if (pos < size) {
      std::string s = str.substr(i, pos - i);
      result.push_back(s);
      i = pos + pattern.size() - 1;
    }
  }
  return result;
}
bool DesCmp(int a, int b) { return a > b; }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << (j - 1) * n + ((i + j - 1) % n) + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
