#include <bits/stdc++.h>
using namespace std;
int n, a[100010], b[100010], paint_ = 0;
char s1[100010], s2[100010];
long long ans = 0;
inline int read() {
  int x = 0, f = 0;
  char c = getchar();
  while (c < '0' || c > '9') f = (c == '-') ? 1 : f, c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return f ? -x : x;
}
void dfs(int x) {
  if (paint_ == 100000 || x == n) return;
  while (b[x]) {
    while (b[x] > 0 && a[x] < 9 && a[x + 1] < 9) {
      a[x]++, a[x + 1]++, b[x]--, paint_++, printf("%d %d\n", x, 1);
      if (paint_ == 100000) return;
    }
    while (b[x] < 0 && a[x] > 0 && a[x + 1] > 0) {
      a[x]--, a[x + 1]--, b[x]++;
      paint_++, printf("%d %d\n", x, -1);
      if (paint_ == 100000) return;
    }
    if (b[x] > 0 && a[x] == 9) return;
    if (b[x] < 0 && a[x] == 0) return;
    if (b[x]) dfs(x + 1);
    if (paint_ == 100000) return;
  }
}
int main() {
  scanf("%d%s%s", &n, s1 + 1, s2 + 1);
  for (int i = (1); i <= (n); i++)
    a[i] = (s1[i] - '0'), b[i] = (s2[i] - '0') - a[i];
  for (int i = (1); i <= (n - 1); i++) b[i + 1] -= b[i], ans += abs(b[i]);
  if (b[n] != 0) return 0 & printf("-1\n");
  printf("%lld\n", ans);
  for (int i = (1); i <= (n - 1); i++) dfs(i);
  return 0;
}
