#include <bits/stdc++.h>
using namespace std;
const int SZ = 1e5 + 100;
const int MX = 1e5;
int n;
int a[SZ], b[SZ], c[SZ];
int cnt = 0;
void rec(int ind, int val) {
  int fir = ind;
  int sec;
  while (true) {
    sec = ind;
    if (val == 1) {
      if (a[ind] == 9) {
        ind++;
        val = -val;
      } else
        break;
    } else {
      if (a[ind] == 0) {
        ind++;
        val = -val;
      } else
        break;
    }
  }
  for (int i = sec; i >= fir; i--) {
    if (cnt == MX) exit(0);
    cout << i << " " << val << "\n";
    a[i] += val;
    a[i - 1] += val;
    val = -val;
    cnt++;
  }
}
int main() {
  ios::sync_with_stdio(false);
  char sim;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> sim;
    a[i] = (int)(sim - '0');
    c[i] = a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> sim;
    b[i] = (int)(sim - '0');
  }
  long long ans = 0;
  long long delt;
  for (int i = 0; i < (n - 1); i++) {
    delt = b[i] - c[i];
    c[i] = b[i];
    c[i + 1] += delt;
    ans += abs(delt);
  }
  if (c[n - 1] == b[n - 1]) {
    cout << ans << endl;
    for (int i = 0; i < (n - 1); i++) {
      while (a[i] < b[i]) {
        rec(i + 1, 1);
      }
      while (a[i] > b[i]) {
        rec(i + 1, -1);
      }
    }
  } else
    cout << -1 << endl;
  return 0;
}
