#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 1e5, P = 1e5;
int n, a[N_MAX], b[N_MAX], t[N_MAX];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) a[i] = s[i] - '0';
  cin >> s;
  for (int i = 0; i < n; i++) b[i] = s[i] - '0';
  t[0] = b[0] - a[0];
  for (int i = 1; i < n - 1; i++) t[i] = b[i] - a[i] - t[i - 1];
  if (b[n - 1] - a[n - 1] != t[n - 2]) {
    cout << "-1\n";
    return 0;
  }
  long long sol = 0;
  for (int i = 0; i < n - 1; i++) sol += (t[i] > 0 ? t[i] : -t[i]);
  cout << sol << "\n";
  int printed = 0, f = 0;
  while (sol > 0) {
    while (a[f] == b[f]) f++;
    bool inc = (a[f] < b[f]);
    int i = f;
    while ((inc && a[i + 1] == 9) || (!inc && a[i + 1] == 0)) {
      inc = !inc;
      i++;
    }
    while (i >= f) {
      int d = (inc ? 1 : -1);
      cout << i + 1 << " " << d << "\n";
      a[i] += d;
      a[i + 1] += d;
      sol--;
      printed++;
      if (printed == P) return 0;
      i--;
      inc = !inc;
    }
  }
  return 0;
}
