#include <bits/stdc++.h>
using namespace std;
namespace IO {
const int sz = 1 << 15;
char inbuf[sz], outbuf[sz];
char *pinbuf = inbuf + sz;
char *poutbuf = outbuf;
inline char _getchar() {
  if (pinbuf == inbuf + sz) fread(inbuf, 1, sz, stdin), pinbuf = inbuf;
  return *(pinbuf++);
}
inline void _putchar(char x) {
  if (poutbuf == outbuf + sz) fwrite(outbuf, 1, sz, stdout), poutbuf = outbuf;
  *(poutbuf++) = x;
}
inline void flush() {
  if (poutbuf != outbuf)
    fwrite(outbuf, 1, poutbuf - outbuf, stdout), poutbuf = outbuf;
}
}  // namespace IO
inline int read() {
  int x = 0, p = 1;
  char c = IO::_getchar();
  while (c < '0' || c > '9') {
    if (c == '-') p = -1;
    c = IO::_getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = IO::_getchar();
  return x * p;
}
namespace Mymath {
long long qp(long long x, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % mod;
    x = x * x % mod;
    p >>= 1;
  }
  return ans;
}
long long inv(long long x, long long mod) { return qp(x, mod - 2, mod); }
long long C(long long N, long long K, long long fact[], long long mod) {
  return fact[N] * inv(fact[K], mod) % mod * inv(fact[N - K], mod) % mod;
}
template <typename Tp>
Tp gcd(Tp A, Tp B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
template <typename Tp>
Tp lcm(Tp A, Tp B) {
  return A * B / gcd(A, B);
}
};  // namespace Mymath
const int Maxn = 100005;
int n;
char tmp[Maxn];
int a[Maxn], b[Maxn], ta[Maxn];
int delt[Maxn];
int main() {
  scanf("%d", &n);
  scanf("%s", tmp);
  for (int i = 0; i < n; i++) a[i] = tmp[i] - '0', ta[i] = a[i];
  scanf("%s", tmp);
  for (int i = 0; i < n; i++) b[i] = tmp[i] - '0';
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    delt[i] = b[i] - a[i];
    ans += abs(delt[i]);
    a[i + 1] += delt[i];
  }
  for (int i = 0; i < n; i++) a[i] = ta[i];
  if (a[n] != 0) {
    printf("-1\n");
    return 0;
  }
  printf("%I64d\n", ans);
  set<int> Av;
  for (int i = 0; i < n - 1; i++) {
    if (!delt[i]) continue;
    int Nd = (delt[i] > 0) ? 1 : -1;
    if (a[i] + Nd < 0 || a[i] + Nd > 9 || a[i + 1] + Nd < 0 ||
        a[i + 1] + Nd > 9) {
      continue;
    }
    Av.insert(i);
  }
  vector<pair<int, int> > Ans;
  while (!Av.empty()) {
    int x = *Av.begin();
    Av.erase(x);
    if (delt[x] == 0) continue;
    if (delt[x] > 0) {
      Ans.push_back(make_pair(x, 1));
      delt[x]--;
      a[x]++;
      a[x + 1]++;
    } else {
      Ans.push_back(make_pair(x, -1));
      delt[x]++;
      a[x]--;
      a[x + 1]--;
    }
    if (Ans.size() == 100000) break;
    if (delt[x] != 0) {
      int Nd = (delt[x] > 0) ? 1 : -1;
      if (!(a[x] + Nd < 0 || a[x] + Nd > 9 || a[x + 1] + Nd < 0 ||
            a[x + 1] + Nd > 9)) {
        Av.insert(x);
      }
    }
    if (x != 0) {
      int px = x - 1;
      if (delt[px] != 0) {
        int Nd = (delt[px] > 0) ? 1 : -1;
        if ((a[px] + Nd < 0 || a[px] + Nd > 9 || a[px + 1] + Nd < 0 ||
             a[px + 1] + Nd > 9)) {
          Av.erase(px);
        } else {
          Av.insert(px);
        }
      }
    }
    if (x != n - 2) {
      int px = x + 1;
      if (delt[px] != 0) {
        int Nd = (delt[px] > 0) ? 1 : -1;
        if ((a[px] + Nd < 0 || a[px] + Nd > 9 || a[px + 1] + Nd < 0 ||
             a[px + 1] + Nd > 9)) {
          Av.erase(px);
        } else {
          Av.insert(px);
        }
      }
    }
  }
  for (int i = 0; i < Ans.size(); i++) {
    printf("%d %d\n", Ans[i].first + 1, Ans[i].second);
  }
  return 0;
}
