#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int n, m, tt = 0, ch[N][64], p[10][10], q[10][64], f[10][N];
map<unsigned long long, int> id;
int qpow(int a, int b) {
  int ret = 1;
  while (b) {
    if (b & 1) ret = 1ll * ret * a % mod;
    a = 1ll * a * a % mod, b >>= 1;
  }
  return ret;
}
int dfs(unsigned long long s) {
  if (id[s]) return id[s];
  id[s] = ++tt;
  for (int i = 0; i < (1 << n); i++) {
    unsigned long long t = s;
    for (int j = 0; j < (1 << n); j++)
      for (int k = 0; k < n; k++)
        if ((j >> k & 1) && (i >> k & 1) && (s >> (j ^ (1 << k)) & 1))
          t |= 1llu << j;
    ch[id[s]][i] = dfs(t);
  }
  return id[s];
}
int main() {
  cin >> n;
  dfs(1);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      cin >> p[i][j], p[i][j] = 1ll * p[i][j] * qpow(100, mod - 2) % mod;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (1 << n); j++) {
      q[i][j] = 1;
      for (int k = 0; k < n; k++) {
        if (j >> k & 1)
          q[i][j] = 1ll * q[i][j] * p[k][i] % mod;
        else
          q[i][j] = 1ll * q[i][j] * (mod + 1 - p[k][i]) % mod;
      }
    }
  f[0][1] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 1; j <= tt; j++)
      for (int k = 0; k < (1 << n); k++)
        f[i + 1][ch[j][k]] =
            (f[i + 1][ch[j][k]] + 1ll * f[i][j] * q[i][k]) % mod;
  if (n < 6)
    cout << f[n][id[(1llu << (1 << n)) - 1]];
  else
    cout << f[n][id[18446744073709551615llu]];
  return 0;
}
