#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int MAXOPS = 1e5;
long long nops;
int ops[MAXOPS][2];
int N;
int incend;
int nums[MAXN];
int goal[MAXN];
int nxtidx[2];
void addbasic(int idx, bool up) {
  assert(0 <= idx && idx < N - 1);
  int by = up * 2 - 1;
  if (nops < MAXOPS) {
    ops[nops][0] = idx + 1;
    ops[nops][1] = by;
  }
  nums[idx] += by;
  nums[idx + 1] += by;
  nops++;
}
void addop(int a, int b, bool upfirst) {
  assert(0 <= a && a < b && b < N);
  bool uplast = !upfirst ^ ((b - a) % 2 == 1);
  if (nops >= MAXOPS) {
    nums[a] += upfirst * 2 - 1;
    nums[b] += uplast * 2 - 1;
    nops += b - a;
  } else {
    bool up = uplast;
    for (int i = b - 1; i >= a; --i, up = !up) {
      addbasic(i, up);
    }
    assert(up == !upfirst);
  }
}
int uptolimit(bool up) { return up * 9; }
bool doinc(int idx, bool up) {
  assert(0 <= nums[idx] && nums[idx] <= 9);
  assert(0 <= nums[idx] + up * 2 - 1 && nums[idx] + up * 2 - 1 <= 9);
  bool change = (nxtidx[up] - idx) % 2 != 1;
  if (nxtidx[up] < N && nums[nxtidx[up]] == uptolimit(up ^ change)) {
    for (; nxtidx[up] < N; ++nxtidx[up], change = !change) {
      if (nums[nxtidx[up]] != uptolimit(up ^ change)) break;
    }
  }
  assert(nxtidx[up] == N ||
         nums[nxtidx[up]] != uptolimit(up ^ !((nxtidx[up] - idx) % 2)));
  if (nxtidx[up] == N) return false;
  addop(idx, nxtidx[up], up);
  assert(nums[nxtidx[up]] != uptolimit(!up ^ change));
  nxtidx[!up] = idx + 1;
  return true;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    char c;
    scanf(" %c", &c);
    nums[i] = c - '0';
  }
  for (int i = 0; i < N; ++i) {
    char c;
    scanf(" %c", &c);
    goal[i] = c - '0';
  }
  for (int i = 0; i < N - 1; ++i) {
    if (nxtidx[0] < i + 1) nxtidx[0] = i + 1;
    if (nxtidx[1] < i + 1) nxtidx[1] = i + 1;
    while (nums[i] != goal[i]) {
      bool success = doinc(i, nums[i] < goal[i]);
      if (!success) {
        printf("-1\n");
        return 0;
      }
    }
    swap(nxtidx[0], nxtidx[1]);
  }
  if (nums[N - 1] == goal[N - 1]) {
    printf("%lld\n", nops);
    for (int i = 0; i < nops && i < MAXOPS; ++i)
      printf("%d %d\n", ops[i][0], ops[i][1]);
  } else {
    printf("-1\n");
  }
  return 0;
}
