#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define vvi vector<vi>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define mod 1000000007ll
#define all(c) c.begin(), c.end()
#define fast_io ios_base::sync_with_stdio(0), cin.tie(0)
int fac[100005];
int power(int a, int b)
{
int ans = 1;
while (b)
{
if (b & 1)
ans = (ans * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return ans;
}
int mod_inverse(int n)
{
return power(n, mod - 2);
}
int ncr(int n, int r)
{
if (n < r)
return 0;
return (fac[n] * mod_inverse(fac[r]) % mod * mod_inverse(fac[n - r]) % mod) % mod;
}
int32_t main()
{
fast_io;
fac[0] = fac[1] = 1;
for (int i = 2; i < 100005; i++)
fac[i] = (i * fac[i - 1]) % mod;
int t = 1;
cin >> t;
while (t--)
{
int ways = 1;
int n;
cin >> n;
string s;
cin >> s;
bool consecutive = false;
int cnt = 0, left_limit = 1, right_limit = 1;
for (int i = 0; i < n; i++)
{
if (s[i] == '-')
{
consecutive = true, cnt++;
}
else
{
consecutive = false;
right_limit = s[i] - '0';
int choices = right_limit - left_limit + 1;
ways = (ways * (ncr(choices + cnt - 1, cnt))) % mod;
left_limit = right_limit;
cnt = 0;
}
}
ways = (ways * (ncr(9 - left_limit + 1 + cnt - 1, cnt))) % mod;
cout << ways << '\n';
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGludCBsb25nIGxvbmcKI2RlZmluZSB2aSB2ZWN0b3I8aW50PgojZGVmaW5lIHZ2aSB2ZWN0b3I8dmk+CiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgZmYgZmlyc3QKI2RlZmluZSBzcyBzZWNvbmQKI2RlZmluZSBtb2QgMTAwMDAwMDAwN2xsCiNkZWZpbmUgYWxsKGMpIGMuYmVnaW4oKSwgYy5lbmQoKQojZGVmaW5lIGZhc3RfaW8gaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKSwgY2luLnRpZSgwKQoKaW50IGZhY1sxMDAwMDVdOwoKaW50IHBvd2VyKGludCBhLCBpbnQgYikKewogICAgaW50IGFucyA9IDE7CiAgICB3aGlsZSAoYikKICAgIHsKICAgICAgICBpZiAoYiAmIDEpCiAgICAgICAgICAgIGFucyA9IChhbnMgKiBhKSAlIG1vZDsKCiAgICAgICAgYSA9IChhICogYSkgJSBtb2Q7CiAgICAgICAgYiA+Pj0gMTsKICAgIH0KICAgIHJldHVybiBhbnM7Cn0KCmludCBtb2RfaW52ZXJzZShpbnQgbikKewogICAgcmV0dXJuIHBvd2VyKG4sIG1vZCAtIDIpOwp9CgppbnQgbmNyKGludCBuLCBpbnQgcikKewogICAgaWYgKG4gPCByKQogICAgICAgIHJldHVybiAwOwogICAgcmV0dXJuIChmYWNbbl0gKiBtb2RfaW52ZXJzZShmYWNbcl0pICUgbW9kICogbW9kX2ludmVyc2UoZmFjW24gLSByXSkgJSBtb2QpICUgbW9kOwp9CgppbnQzMl90IG1haW4oKQp7CiAgICBmYXN0X2lvOwogICAgZmFjWzBdID0gZmFjWzFdID0gMTsKICAgIGZvciAoaW50IGkgPSAyOyBpIDwgMTAwMDA1OyBpKyspCiAgICAgICAgZmFjW2ldID0gKGkgKiBmYWNbaSAtIDFdKSAlIG1vZDsKCiAgICBpbnQgdCA9IDE7CiAgICBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pCiAgICB7CiAgICAgICAgaW50IHdheXMgPSAxOwogICAgICAgIGludCBuOwogICAgICAgIGNpbiA+PiBuOwogICAgICAgIHN0cmluZyBzOwogICAgICAgIGNpbiA+PiBzOwoKICAgICAgICBib29sIGNvbnNlY3V0aXZlID0gZmFsc2U7CiAgICAgICAgaW50IGNudCA9IDAsIGxlZnRfbGltaXQgPSAxLCByaWdodF9saW1pdCA9IDE7CgogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKHNbaV0gPT0gJy0nKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBjb25zZWN1dGl2ZSA9IHRydWUsIGNudCsrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgY29uc2VjdXRpdmUgPSBmYWxzZTsKICAgICAgICAgICAgICAgIHJpZ2h0X2xpbWl0ID0gc1tpXSAtICcwJzsKCiAgICAgICAgICAgICAgICBpbnQgY2hvaWNlcyA9IHJpZ2h0X2xpbWl0IC0gbGVmdF9saW1pdCArIDE7CiAgICAgICAgICAgICAgICB3YXlzID0gKHdheXMgKiAobmNyKGNob2ljZXMgKyBjbnQgLSAxLCBjbnQpKSkgJSBtb2Q7CgogICAgICAgICAgICAgICAgbGVmdF9saW1pdCA9IHJpZ2h0X2xpbWl0OwogICAgICAgICAgICAgICAgY250ID0gMDsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgd2F5cyA9ICh3YXlzICogKG5jcig5IC0gbGVmdF9saW1pdCArIDEgKyBjbnQgLSAxLCBjbnQpKSkgJSBtb2Q7CgogICAgICAgIGNvdXQgPDwgd2F5cyA8PCAnXG4nOwogICAgfQogICAgcmV0dXJuIDA7Cn0=