#include <bits/stdc++.h>
using namespace std;
int n, a[100100], b[100100], c[100100];
long long ans;
char ch[100100];
void init(int *a) {
  scanf("%s", ch + 1);
  for (int i = 1; i <= n; ++i) a[i] = ch[i] - 48;
}
void dfs(int x, int w) {
  if (!ans) return;
  if (0 <= a[x + 1] + w && a[x + 1] + w <= 9) {
    printf("%d %d\n", x, w);
    a[x] += w, a[x + 1] += w;
    --ans;
    return;
  }
  dfs(x + 1, -w);
  if (!ans) return;
  printf("%d %d\n", x, w);
  a[x] += w;
  a[x + 1] += w;
  --ans;
}
int main() {
  scanf("%d", &n);
  init(a);
  init(b);
  for (int i = 1; i <= n; ++i) c[i] = a[i];
  for (int i = 1; i < n; ++i) {
    int d = b[i] - c[i];
    c[i] += d;
    c[i + 1] += d;
    ans += abs(d);
  }
  if (c[n] != b[n]) {
    puts("-1");
    return 0;
  }
  cout << ans << endl;
  ans = min(ans, 100000ll);
  for (int i = 1; i < n && ans > 0; ++i)
    while (a[i] != b[i] && ans > 0) dfs(i, (b[i] - a[i]) / abs(b[i] - a[i]));
  return 0;
}
