#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n, a[N], b[N], aa[N], bb[N];
long long ans;
void go(int i, int x) {
  if (ans == 0) return;
  if (x == 1) {
    if (a[i + 1] == 9) go(i + 1, -1);
    if (ans == 0) return;
    cout << i + 1 << ' ' << 1 << "\n";
    --ans;
    ++a[i];
    ++a[i + 1];
  } else {
    if (a[i + 1] == 0) go(i + 1, 1);
    if (ans == 0) return;
    cout << i + 1 << ' ' << -1 << "\n";
    --ans;
    --a[i];
    --a[i + 1];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    b[i] = c - '0';
    aa[i] = a[i];
    bb[i] = b[i];
    if (i % 2 == 0) {
      sum1 += a[i];
      sum2 += b[i];
    } else {
      sum1 -= a[i];
      sum2 -= b[i];
    }
  }
  if (sum1 != sum2) return cout << -1, 0;
  ans = 0;
  for (int i = 0; i + 1 < n; i++) {
    if (aa[i] < bb[i]) {
      ans += bb[i] - aa[i];
      aa[i + 1] += bb[i] - aa[i];
    } else {
      ans += aa[i] - bb[i];
      aa[i + 1] -= aa[i] - bb[i];
    }
  }
  cout << ans << "\n";
  ans = min(ans, 100000ll);
  for (int i = 0; i + 1 < n; i++) {
    while (ans > 0 && a[i] < b[i]) {
      go(i, 1);
    }
    while (ans > 0 && a[i] > b[i]) {
      go(i, -1);
    }
  }
}
