#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
char s[maxn];
int n, a[maxn], b[maxn], c[maxn];
void input() {
  cin >> n >> s + 1;
  for (int i = 1; i <= n; ++i) a[i] = s[i] - '0', c[i] = a[i];
  cin >> s + 1;
  for (int i = 1; i <= n; ++i) b[i] = s[i] - '0';
}
long long cts;
void dfs(int x, int w) {
  if (!cts) return;
  if (a[x + 1] + w < 0 or a[x + 1] + w > 9) {
    dfs(x + 1, -w);
    if (!cts) return;
  }
  cout << x << ' ' << w << endl;
  a[x] += w;
  a[x + 1] += w;
  --cts;
}
void slove() {
  cts = 0;
  for (int i = 1; i < n; ++i) {
    int dx = b[i] - c[i];
    c[i] += dx, c[i + 1] += dx;
    cts += abs(dx);
  }
  if (c[n] != b[n]) {
    cout << "-1" << endl;
    return;
  }
  cout << cts << endl;
  cts = min(cts, 100000LL);
  for (int i = 1; i < n and cts; ++i) {
    while (a[i] != b[i] and cts) {
      dfs(i, a[i] > b[i] ? -1 : 1);
    }
  }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  input();
  slove();
  return 0;
}
