#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  char c = getchar();
  long long tot = 1;
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    tot = -1;
    c = getchar();
  }
  long long sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * tot;
}
inline void wr(long long x) {
  if (x < 0) {
    putchar('-');
    wr(-x);
    return;
  }
  if (x >= 10) wr(x / 10);
  putchar(x % 10 + '0');
}
inline void wrn(long long x) {
  wr(x);
  putchar('\n');
}
inline void wri(long long x) {
  wr(x);
  putchar(' ');
}
inline void wrn(long long x, long long y) {
  wri(x);
  wrn(y);
}
inline void wrn(long long a, long long b, long long c) {
  wri(a);
  wrn(b, c);
}
long long n, m, ans, a[200055], b[200055], num, sum[200055], wzp;
char str[200055], str1[200055];
signed main() {
  n = read();
  scanf("%s", str + 1);
  for (long long i = (1); i <= (n); i++) a[i] = str[i] - '0';
  scanf("%s", str + 1);
  for (long long i = (1); i <= (n); i++) b[i] = str[i] - '0';
  for (long long i = (1); i <= (n); i++)
    num += abs(sum[i] = -(a[i] + sum[i - 1]) + b[i]);
  if (sum[n]) return puts("-1"), 0;
  ;
  wrn(num);
  while (1) {
    long long pd = 0;
    for (long long i = (1); i <= (n); i++) {
      if (sum[i] != 0) {
        if (sum[i] < 0 && (a[i] > 1 || (a[i] > 0 && i > 1)) && a[i + 1] >= 1)
          wrn(i, -1), a[i]--, a[i + 1]--, sum[i]++, wzp++, pd = 1;
        if (wzp == 100000) return 0;
        if (sum[i] > 0 && a[i] < 9 && a[i + 1] < 9)
          wrn(i, 1), a[i]++, a[i + 1]++, sum[i]--, wzp++, pd = 1;
        if (wzp == 100000) return 0;
      }
    }
    if (!pd) break;
  }
  num = num;
  return 0;
}
