#include <bits/stdc++.h>
using namespace std;
int n;
char s[100005];
char t[100005];
int a[100005];
int b[100005];
int c[100005];
long long times;
void fail() {
  printf("-1\n");
  exit(0);
}
void dfs(int pos, int w) {
  if (b[pos + 1] + w < 0 || b[pos + 1] + w > 9) dfs(pos + 1, -w);
  b[pos] += w;
  b[pos + 1] += w;
  printf("%d %d\n", pos, w);
  if (--times == 0) exit(0);
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) b[i] = s[i] - '0';
  scanf("%s", t + 1);
  for (int i = 1; i <= n; ++i) c[i] = t[i] - '0';
  for (int i = 1; i <= n; ++i) {
    a[i] = (c[i] - b[i]) - a[i - 1];
    times += abs(a[i]);
  }
  if (a[n]) fail();
  printf("%lld\n", times);
  if (!times) return 0;
  times = min(times, 100000LL);
  for (int i = 1; i < n; ++i) {
    while (b[i] != c[i]) dfs(i, b[i] < c[i] ? 1 : -1);
  }
  return 0;
}
