#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
string direc = "URDL";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
unordered_map<bitset<128>, int> mp;
int cnt, dp[65000][130];
int dfs(bitset<128> s) {
  if (mp.find(s) != mp.end()) return mp[s];
  int z = cnt++;
  mp[s] = z;
  for (int(i) = 0; (i) < (int)(1 << n); (i)++) {
    bitset<128> t = s;
    for (int(j) = 0; (j) < (int)(1 << n); (j)++)
      if (!t[j]) {
        for (int k = i & j; k; k ^= k & -k)
          if (s[j ^ (k & -k)]) {
            t[j] = 1;
            break;
          }
      }
    dp[z][i] = dfs(t);
  }
  return z;
}
int p[10][10], q[10][130], f[9][65000];
void fmain(int tid) {
  scanf("%d", &n);
  dfs(1);
  int inv = fastPow(100, 1000000007 - 2);
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    for (int(j) = 0; (j) < (int)(n); (j)++) {
      scanf("%d", &p[i][j]);
      p[i][j] = (long long)p[i][j] * inv % 1000000007;
    }
  }
  for (int(j) = 0; (j) < (int)(n); (j)++) {
    for (int(s) = 0; (s) < (int)(1 << n); (s)++) {
      q[j][s] = 1;
      for (int(z) = 0; (z) < (int)(n); (z)++)
        if (s & (1 << z))
          q[j][s] = (long long)q[j][s] * p[z][j] % 1000000007;
        else
          q[j][s] =
              (long long)q[j][s] * (1000000007 + 1 - p[z][j]) % 1000000007;
    }
  }
  f[0][0] = 1;
  for (int(i) = 0; (i) < (int)(n); (i)++)
    for (int(j) = 0; (j) < (int)(cnt); (j)++) {
      for (int(k) = 0; (k) < (int)(1 << n); (k)++) {
        addmod(f[i + 1][dp[j][k]], (long long)f[i][j] * q[i][k] % 1000000007);
      }
    }
  bitset<128> z;
  for (int(i) = 0; (i) < (int)(1 << n); (i)++) z[i] = 1;
  printf("%d\n", f[n][mp[z]]);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
