#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
int a[N];
int b[N];
int c[N];
int n;
long long ans;
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%1d", a + i);
    c[i] = a[i];
  }
  for (int i = 1; i <= n; i++) {
    scanf("%1d", b + i);
  }
  for (int i = 1; i < n; i++) {
    int delta = c[i] - b[i];
    c[i] -= delta;
    c[i + 1] -= delta;
    ans += abs(delta);
  }
}
void check(int now, int add) {
  if (ans == 0) return;
  if (0 <= a[now + 1] + add && a[now + 1] + add <= 9) {
    printf("%d %d\n", now, add);
    a[now] += add;
    a[now + 1] += add;
    ans--;
    return;
  }
  check(now + 1, -add);
  if (ans == 0) return;
  printf("%d %d\n", now, add);
  a[now] += add;
  a[now + 1] += add;
  ans--;
}
void work() {
  printf("%lld\n", ans);
  if (ans > 100000) ans = 100000;
  for (int i = 1; i < n && ans > 0; i++)
    while (a[i] != b[i] && ans) check(i, (b[i] > a[i]) ? 1 : -1);
}
int main() {
  init();
  if (c[n] == b[n])
    work();
  else
    printf("-1");
  return 0;
}
