#include <bits/stdc++.h>
using namespace std;
char C, s[100005];
int n, a[100005], b[100005], c[100005], tot, x, y, t;
long long ans = 0;
inline void R(int &x) {
  x = 0;
  char C = getchar();
  while (!isdigit(C)) C = getchar();
  while (isdigit(C)) x = (x << 3) + (x << 1) + (C ^ 48), C = getchar();
}
int main() {
  R(n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] ^ 48;
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) b[i] = s[i] ^ 48;
  c[1] = b[1] - a[1];
  ans = c[1] > 0 ? c[1] : -c[1];
  for (int i = 2; i <= n; i++) {
    c[i] = b[i] - a[i] - c[i - 1];
    ans += c[i] > 0 ? c[i] : -c[i];
  }
  if (c[n]) {
    printf("-1\n");
    return 0;
  }
  printf("%lld\n", ans);
  ans = min(ans, 100000ll);
  x = y = 1;
  while (ans--) {
    while (!c[x]) x++, y++;
    while (c[y] < 0 && !a[y + 1] || (c[y] > 0 && a[y + 1] == 9)) y++;
    t = c[y] < 0 ? -1 : 1;
    printf("%d %d\n", y, t);
    a[y] += t, a[y + 1] += t;
    c[y] -= t;
    y = max(y - 1, x);
  }
  return 0;
}
