#include <bits/stdc++.h>
using namespace std;
char a[100010], b[100010];
int aa[100010], bb[100010], c[100010], cnt;
const int maxx = 1e5;
void add(int x, int z) {
  if (aa[x + 1] + z > 9) {
    add(x + 1, -1);
  } else if (aa[x + 1] + z < 0) {
    add(x + 1, 1);
  }
  printf("%d %d\n", x, z);
  aa[x] += z;
  aa[x + 1] += z;
  cnt++;
  if (cnt == maxx) exit(0);
}
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  for (int i = 1; i <= n; i++) {
    aa[i] = a[i] - '0';
    bb[i] = b[i] - '0';
    c[i] = aa[i];
  }
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    ans += abs(c[i] - bb[i]);
    c[i + 1] += bb[i] - c[i];
  }
  if (c[n] != bb[n])
    puts("-1");
  else {
    printf("%lld\n", ans);
    for (int i = 1; i < n; i++) {
      while (aa[i] < bb[i]) add(i, 1);
      while (aa[i] > bb[i]) add(i, -1);
    }
  }
  return 0;
}
