#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 100010;
const int MAX = 100000;
const int INF = 2147483600;
int a[MAXN + 1], b[MAXN + 1], c[MAXN + 1], d[MAXN + 1];
long long suma[2], sumb[2];
int N;
char s[MAXN + 1], t[MAXN + 1];
int post[MAXN + 1], oprt[MAXN + 1], top;
inline void OP(int pos, int opr) {
  a[pos] += opr;
  a[pos + 1] += opr;
  if (top < MAX) {
    post[++top] = pos;
    oprt[top] = opr;
  }
  return;
}
inline bool Can(int pos, int opr) {
  return ((a[pos] + opr < 10 && a[pos] + opr >= 0 && a[pos + 1] + opr < 10 &&
           a[pos + 1] + opr >= 0) &&
          pos < N);
}
int f[MAXN + 1];
inline int val(int x) { return (x < 0 ? -1 : 1); }
inline void dfs(int k) {
  if (!f[k]) return;
  if (top >= MAX) return;
  bool flag = 0;
  while (f[k] && Can(k, val(f[k])))
    OP(k, val(f[k])), f[k] -= val(f[k]), flag = 1;
  if (!flag) return;
  dfs(k - 1);
  dfs(k + 1);
  return;
}
int main() {
  N = read();
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = 1; i <= N; i++) a[i] = s[i] - '0', b[i] = t[i] - '0';
  for (int i = 1; i <= N; i++) suma[i & 1] += a[i];
  for (int i = 1; i <= N; i++) sumb[i & 1] += b[i];
  if (suma[0] - suma[1] != sumb[0] - sumb[1]) {
    puts("-1");
    return 0;
  }
  long long ans = 0;
  long long dsum = ((sumb[0] + sumb[1]) - (suma[0] + suma[1])) / 2;
  memcpy(c, a, sizeof(a));
  memcpy(d, b, sizeof(b));
  long long sum = 0;
  for (int i = 1; i <= N; i++) {
    f[i - 1] = sum;
    sum = -sum + b[i] - a[i];
    ans += abs(sum);
  }
  dsum = ((sumb[0] + sumb[1]) - (suma[0] + suma[1])) / 2;
  top = 0;
  printf("%lld\n", ans);
  memcpy(a, c, sizeof(a));
  memcpy(b, d, sizeof(b));
  for (int i = 1; i < N; i++) dfs(i);
  for (int i = 1; i <= min(top, MAX); i++) {
    printf("%d %d\n", post[i], oprt[i]);
  }
  return 0;
}
