#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int n;
long long a[maxn], b[maxn], ans;
char s[maxn], t[maxn];
bool ok = 0;
void dfs(int x, int k) {
  if (ok) return;
  if (s[x + 1] + k > '9' || s[x + 1] + k < '0') dfs(x + 1, -k);
  if (ok) return;
  printf("%d %d\n", x, k);
  s[x] += k;
  s[x + 1] += k;
  ans--;
  if (ans == 0) ok = 1;
}
int main() {
  scanf("%d%s%s", &n, s + 1, 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++)
    if (a[i] > b[i]) {
      long long t = a[i] - b[i];
      a[i] -= t;
      a[i + 1] -= t;
      ans += t;
    } else if (a[i] < b[i]) {
      long long t = b[i] - a[i];
      a[i] += t;
      a[i + 1] += t;
      ans += t;
    }
  if (a[n] != b[n]) {
    printf("-1\n");
    return 0;
  }
  printf("%lld\n", ans);
  ans = min(ans, 100000ll);
  for (int i = 1; i < n && !ok; i++) {
    while (s[i] != t[i] && !ok) dfs(i, s[i] > t[i] ? -1 : 1);
  }
  return 0;
}
