#include <bits/stdc++.h>
using namespace std;
int N;
const int MAX_N = 1e5;
char rwA[MAX_N + 1], rwB[MAX_N + 1];
int A[MAX_N], B[MAX_N], tmp[MAX_N];
int main() {
  scanf("%d %s %s", &N, rwA, rwB);
  for (int i = (0); i < (N); i++) {
    A[i] = rwA[i] - '0';
    B[i] = rwB[i] - '0';
  }
  long long ans = 0;
  for (int i = (0); i < (N); i++) tmp[i] = A[i];
  for (int i = (0); i < (N - 1); i++) {
    int dif = B[i] - tmp[i];
    ans += abs(dif);
    tmp[i] += dif;
    tmp[i + 1] += dif;
  }
  if (tmp[N - 1] == B[N - 1]) {
    printf("%I64d\n", ans);
    for (int i = (0); i < (N); i++) tmp[i] = A[i];
    long long c = min(ans, (long long)1e5);
    for (int i = (0); i < (N - 1); i++) {
      int sgn;
      while (tmp[i] != B[i]) {
        if (B[i] > tmp[i]) {
          sgn = 1;
        } else {
          sgn = -1;
        }
        int inx = i;
        while (tmp[inx + 1] + sgn < 0 || tmp[inx + 1] + sgn > 9) {
          inx++;
          sgn *= -1;
        }
        for (; inx >= i; inx--) {
          printf("%d %d\n", inx + 1, sgn);
          tmp[inx] += sgn;
          tmp[inx + 1] += sgn;
          sgn *= -1;
          c--;
          if (c == 0) {
            return 0;
          }
        }
      }
    }
  } else {
    printf("-1\n");
  }
}
