#include <bits/stdc++.h>
using namespace std;
const int N = 128, mod = 1e9 + 7;
template <typename T>
void read(T &x) {
  int ch = getchar();
  x = 0;
  bool f = false;
  for (; ch < '0' || ch > '9'; ch = getchar()) f |= ch == '-';
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  if (f) x = -x;
}
void qmo(int &x) { x += x >> 31 & mod; }
int ksm(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = (unsigned long long)a * a % mod)
    if (b & 1) res = (unsigned long long)res * a % mod;
  return res;
}
int n, lim, p[7][7], siz[N], id[N], bit[8], tra[8][7][35], val[N];
unordered_map<unsigned long long, int> f[2];
unsigned long long pos[N];
int main() {
  read(n);
  lim = 1 << n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) read(p[i][j]);
  for (int i = 0; i < lim; ++i) id[i] = bit[siz[i] = siz[i >> 1] + (i & 1)]++;
  for (int i = 0; i < lim; ++i)
    for (int j = 0; j < n; ++j)
      tra[siz[i]][j][id[i]] = (i >> j & 1) ? -1 : id[i | (1 << j)];
  int cur = 0;
  f[0][1] = 1;
  for (int i = 0; i < n; ++i, cur ^= 1) {
    f[!cur].clear();
    for (int j = 0; j < lim; ++j) {
      val[j] = 1;
      for (int k = 0; k < n; ++k)
        if (j >> k & 1)
          val[j] = (unsigned long long)val[j] * p[i][k] % mod;
        else
          val[j] = val[j] * (100ll - p[i][k]) % mod;
    }
    int d = bit[i];
    for (auto [u, v] : f[cur]) {
      memset(pos, 0, sizeof pos);
      for (int j = 0; j < n; ++j)
        for (int k = 0; k < d; ++k)
          if ((u >> k & 1) && ~tra[i][j][k])
            pos[1 << j] |= 1ull << tra[i][j][k];
      for (int j = 0; j < lim; ++j) {
        pos[j] = pos[j & -j] | pos[j ^ (j & -j)];
        f[!cur][pos[j]] =
            (f[!cur][pos[j]] + (unsigned long long)v * val[j]) % mod;
      }
    }
  }
  printf("%lld\n",
         (unsigned long long)f[cur][1] * ksm(100, mod - 1 - n * n) % mod);
}
