#include <bits/stdc++.h>
using namespace std;
const int inv = 570000004, mod = 1e9 + 7;
unordered_map<bitset<128>, int> mp;
bitset<128> E;
int tot, p[8][8], trans[100005][128];
int n, S, fp[8][8], f[8][100005], P[100005];
int Dfs(bitset<128> x) {
  if (mp.find(x) != mp.end()) return mp[x];
  int now = mp[x] = ++tot;
  bitset<128> A[8], tmp;
  for (int i = 0; i < n; ++i)
    for (int s = 0; s <= S; ++s) A[i][s | (1 << i)] = A[i][s | (1 << i)] | x[s];
  for (int s = 0, i; s <= S; ++s) {
    for (tmp = x, i = 0; i < n; ++i)
      if (s >> i & 1) tmp |= A[i];
    trans[now][s] = Dfs(tmp);
  }
  return now;
}
void Add(int &x, int y) { (x += y) >= mod ? x -= mod : x; }
int main() {
  cin >> n, S = (1 << n) - 1, E[0] = 1, Dfs(E);
  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] * inv % mod,
                      fp[i][j] = mod + 1 - p[i][j];
  f[0][1] = 1;
  for (int i = 0; i < n; ++i) {
    for (int s = 0; s <= S; ++s) {
      P[s] = 1;
      for (int j = 0; j < n; ++j)
        if (s >> j & 1)
          P[s] = 1ll * P[s] * p[j][i] % mod;
        else
          P[s] = 1ll * P[s] * fp[j][i] % mod;
    }
    for (int now = 1; now <= tot; ++now)
      if (f[i][now])
        for (int s = 0; s <= S; ++s)
          Add(f[i + 1][trans[now][s]], 1ll * f[i][now] * P[s] % mod);
  }
  for (int i = 1; i <= S; ++i) E[i] = 1;
  cout << f[n][mp[E]];
  return 0;
}
