#include <bits/stdc++.h>
using namespace std;
int i, j, k, m, n, o, p, l, t, sum, tot;
char s1[100005], s2[100005];
int a[100005], b[100005], ans[100005][2];
long long s;
void pr() {
  if (p) return;
  p = 1;
  for (int i = 1; i <= sum; i++) printf("%d %d\n", ans[i][0], ans[i][1]);
}
void change(int pos, int ad) {
  if (ad == -1) {
    if (o == 1) return;
    if (a[pos + 1] == 0) change(pos + 1, -ad);
    if (o == 1) return;
    ans[++sum][0] = pos, ans[sum][1] = ad, a[pos]--, a[pos + 1]--;
    if (sum >= 100000) {
      pr();
      o = 1;
      return;
    }
  } else {
    if (o == 1) return;
    if (a[pos + 1] == 9) change(pos + 1, -ad);
    if (o == 1) return;
    ans[++sum][0] = pos, ans[sum][1] = ad, a[pos]++, a[pos + 1]++;
    if (sum >= 100000) {
      pr();
      o = 1;
      return;
    }
  }
}
int main() {
  scanf("%d\n", &n);
  scanf("%s\n", s1 + 1);
  scanf("%s\n", s2 + 1);
  for (i = 1; i <= n; i++) a[i] = s1[i] - '0', b[i] = s2[i] - '0';
  for (i = n; i >= 1; i--) {
    k = b[i] - a[i];
    ans[++sum][0] = i - 1, ans[sum][1] = k;
    a[i] += k, a[i - 1] += k;
  }
  for (i = 0; i <= n; i++)
    if (a[i] < 0 || a[i] > 9 || a[i] != b[i]) {
      puts("-1");
      return 0;
    }
  for (i = 1; i <= sum; i++)
    if (ans[i][1] != 0) s += abs(ans[i][1]);
  printf("%lld\n", s), sum = 0;
  for (i = 1; i <= n; i++) a[i] = s1[i] - '0';
  memset(ans, 0, sizeof(ans));
  for (i = 1; i <= n; i++) {
    while (a[i] > b[i]) {
      if (a[i + 1] == 0) change(i + 1, 1);
      a[i]--, a[i + 1]--, ans[++sum][0] = i, ans[sum][1] = -1;
      if (sum >= 100000) {
        pr();
        return 0;
      }
    }
    while (a[i] < b[i]) {
      if (a[i + 1] == 9) change(i + 1, -1);
      a[i]++, a[i + 1]++, ans[++sum][0] = i, ans[sum][1] = 1;
      if (sum >= 100000) {
        pr();
        return 0;
      }
    }
  }
  pr();
  return 0;
}
