#include <bits/stdc++.h>
using namespace std;
const unsigned _mod = 998244353;
const unsigned mod = 1e9 + 7;
const long long infi = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long qpow(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x;
    y >>= 1ll;
    x = x * x;
  }
  return ret;
}
long long ksm(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % mod;
    y >>= 1ll;
    x = x * x % mod;
  }
  return ret;
}
long long _gcd(long long x, long long y) { return y ? _gcd(y, x % y) : x; }
string s, t;
long long ans, res, n;
void dfs(int x, int op) {
  if (!isdigit(s[x + 1] + op)) dfs(x + 1, -op);
  if (--ans >= 0)
    s[x] += op, s[x + 1] += op, cout << x + 1 << ' ' << op << '\n';
}
int main() {
  cin >> n >> s >> t;
  for (register long long i = 0; i <= n - 1; ++i)
    res = s[i] - t[i] - res, ans += abs(res);
  if (res) return puts("-1"), 0;
  cout << ans << '\n';
  ans = min(ans, 100000ll);
  for (register long long i = 0; i <= n - 1; ++i)
    while (ans > 0 && s[i] != t[i]) dfs(i, 1 - 2 * (s[i] > t[i]));
  return 0;
}
