#include <bits/stdc++.h>
using namespace std;
int n, i, mov, pr, j, a[100001], b[100001], c[100001], q[100001];
long long ans;
char s;
void dg(int x) {
  if (!mov) exit(0);
  if (x == n) return;
  int change = c[x] > 0 ? 1 : -1;
  while (c[x]) {
    if ((c[x] > 0 && a[x + 1] == 9) || (c[x] < 0 && !a[x + 1])) dg(x + 1);
    if ((c[x] > 0 && a[x] == 9) || (c[x] < 0 && !a[x])) return;
    c[x] -= change;
    a[x] += change;
    a[x + 1] += change;
    mov--;
    printf("%d %d\n", x, change);
    if (!mov) exit(0);
  }
  dg(x + 1);
}
int main() {
  scanf("%d", &n);
  s = getchar();
  while (s < '0' || s > '9') s = getchar();
  i = 0;
  while (s >= '0' && s <= '9') {
    a[++i] = s - '0';
    s = getchar();
  }
  while (s < '0' || s > '9') s = getchar();
  i = 0;
  while (s >= '0' && s <= '9') {
    b[++i] = s - '0';
    s = getchar();
  }
  for (i = 1; i <= n; i++) q[i] = a[i];
  for (i = 1; i < n; i++) {
    c[i] = b[i] - a[i];
    a[i + 1] += b[i] - a[i];
    ans += abs(c[i]);
  }
  if (a[n] != b[n])
    printf("-1");
  else {
    printf("%lld\n", ans);
    mov = min(ans, (long long)1e5);
    for (i = 1; i <= n; i++) a[i] = q[i];
    dg(1);
  }
  return 0;
}
