#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
struct answer {
  int a, b;
};
vector<answer> ans;
int n;
char a[MAX], b[MAX], r[MAX];
void add(int i);
void sub(int i);
long long answers() {
  long long res = 0;
  static int x[MAX], y[MAX];
  for (int i = 1; i <= n; i++) {
    x[i] = a[i] ^ 48;
    y[i] = b[i] ^ 48;
  }
  for (int i = 1; i < n; i++) {
    int t = y[i] - x[i];
    x[i] += t;
    x[i + 1] += t;
    res += abs(t);
  }
  if (x[n] != y[n]) {
    cout << -1 << endl;
    exit(0);
  }
  return res;
}
int main() {
  cin >> n;
  cin >> (a + 1) >> (b + 1);
  strcpy(r + 1, a + 1);
  cout << answers() << endl;
  for (int i = 1; i < n; i++) {
    while (a[i] < b[i] && ans.size() < (int)1e5) {
      add(i);
    }
    while (a[i] > b[i] && ans.size() < (int)1e5) {
      sub(i);
    }
  }
  for (int i = 0; i < 1e5 && i < ans.size(); i++) {
    cout << ans[i].a << " " << ans[i].b << endl;
  }
  return 0;
}
void add(int i) {
  if (i == n) {
    cout << -1 << endl;
    exit(0);
  }
  if (a[i + 1] == '9') sub(i + 1);
  ans.push_back((answer){i, 1});
  ++a[i], ++a[i + 1];
}
void sub(int i) {
  if (i == n) {
    cout << -1 << endl;
    exit(0);
  }
  if (a[i + 1] == '0') add(i + 1);
  ans.push_back((answer){i, -1});
  --a[i];
  --a[i + 1];
}
