#include <bits/stdc++.h>
using namespace std;
const int N = 7, M = 20, MOD = 1000 * 1000 * 1000 + 7;
int sum(int a, int b) {
  a += b;
  if (a < 0)
    a += MOD;
  else if (a >= MOD)
    a -= MOD;
  return a;
}
void _sum(int &a, int b) { a = sum(a, b); }
int mul(int a, int b) { return 1LL * a * b % MOD; }
void _mul(int &a, int b) { a = mul(a, b); }
int power(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) _mul(res, a);
    _mul(a, a);
    b >>= 1;
  }
  return res;
}
int inv(int x) { return power(x, MOD - 2); }
int n, f[1 << N], p[N][N], dp[N][1 << M], pro[N][1 << N];
vector<int> vec[N];
void input() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> p[i][j];
      _mul(p[i][j], inv(100));
    }
    for (int mask = 0; mask < (1 << n); mask++) {
      pro[i][mask] = 1;
      for (int j = 0; j < n; j++)
        if (mask & (1 << j))
          _mul(pro[i][mask], p[i][j]);
        else
          _mul(pro[i][mask], sum(1, -p[i][j]));
    }
  }
}
void pre_pro() {
  for (int i = 0; i < (1 << n); i++) {
    f[i] = vec[__builtin_popcount(i)].size();
    vec[__builtin_popcount(i)].push_back(i);
  }
}
void act(int i, int mask, int nei) {
  int nxt = 0;
  vector<int> a, b;
  for (int j = 0; j < vec[i].size(); j++)
    if (mask & (1 << j)) a.push_back(vec[i][j]);
  for (int j = 0; j < n; j++)
    if (nei & (1 << j)) b.push_back(j);
  for (int x : a)
    for (int y : b)
      if ((x & (1 << y)) == false) nxt |= (1 << f[x | (1 << y)]);
  _sum(dp[i + 1][nxt], mul(dp[i][mask], pro[i + 1][nei]));
}
void solve() {
  dp[0][1] = 1;
  for (int i = 0; i < n; i++)
    for (int mask = 0; mask < (1 << vec[i].size()); mask++)
      if (dp[i][mask])
        for (int nei = 0; nei < (1 << n); nei++) act(i, mask, nei);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  input();
  pre_pro();
  solve();
  cout << dp[n][1];
  return 0;
}
