#include <bits/stdc++.h>
const int N = 100005;
int n, a[N], b[N], c[N];
long long ans;
char s1[N], s2[N];
int main() {
  scanf("%d", &n);
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  for (int i = 1; i <= n; i++) a[i] = s1[i] - '0', b[i] = s2[i] - '0';
  for (int i = 1; i <= n; i++) c[i] = b[i] - a[i] - c[i - 1];
  if (c[n]) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) ans = ans + abs(c[i]);
  printf("%lld\n", ans);
  ans = std::min(ans, 100000ll);
  int p = 1, now = 0;
  while (ans--) {
    while (!c[p]) p++;
    if (now < p) now = p;
    while ((a[now + 1] == 9 && c[now] > 0) || (a[now + 1] == 0 && c[now] < 0))
      now++;
    int opt = c[now] > 0 ? 1 : -1;
    printf("%d %d\n", now, opt);
    c[now] -= opt, a[now] += opt, a[now + 1] += opt;
    now--;
  }
}
