#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
char a[100010], b[100010];
int aa[100010], bb[100010], aaa[100010], bbb[100010];
int cnt, n;
struct s {
  int a, b;
} z[100010];
inline void f(int pos, int num) {
  if (cnt >= 100000) {
    return;
  }
  int i, j, qq = 0, zz;
  if (num > 0) {
    zz = 1;
  } else {
    zz = -1;
  }
  while (1) {
    if (qq == abs(num)) {
      break;
    }
    if (aa[pos + 1] + zz > 9 || aa[pos + 1] + zz < 0) {
      if (cnt >= 100000) {
        return;
      }
      f(pos + 1, -zz);
      if (cnt >= 100000) {
        return;
      }
    } else {
      if (cnt < 100000) {
        z[cnt].a = pos;
        z[cnt++].b = zz;
      }
      if (cnt >= 100000) {
        return;
      }
      aa[pos] += zz;
      aa[pos + 1] += zz;
      qq++;
    }
  }
}
int main() {
  int i, j;
  long long ans;
  while (~scanf("%d", &n)) {
    scanf("%s %s", a, b);
    ans = 0;
    for (i = 0; i < n; i++) {
      aa[i] = a[i] - 48;
      bb[i] = b[i] - 48;
      aaa[i] = aa[i];
      bbb[i] = bb[i];
    }
    for (i = 0; i < n - 1; i++) {
      aaa[i + 1] -= aaa[i] - bbb[i];
      ans += abs(aaa[i] - bbb[i]);
    }
    if (aaa[n - 1] != bbb[n - 1]) {
      printf("-1\n");
      continue;
    }
    cnt = 0;
    for (i = 0; i < n; i++) {
      if (aa[i] != bb[i]) {
        f(i, bb[i] - aa[i]);
        if (cnt >= 100000) {
          break;
        }
      }
    }
    printf("%lld\n", ans);
    for (i = 0; i < min(ans, (long long)100000); i++) {
      printf("%d %d\n", z[i].a + 1, z[i].b);
    }
  }
}
