#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  int curr = 0;
  vector<long long> change(n - 1, 0), sign(n - 1, 0);
  long long c = 0;
  for (int i = 0; i < n - 1; i++) {
    change[i] = b[i] - a[i] - curr;
    if (change[i] > 0)
      sign[i] = 1;
    else if (change[i] < 0)
      sign[i] = -1;
    c += 1ll * abs(change[i]);
    curr = change[i];
  }
  if (a[n - 1] + curr != b[n - 1]) {
    cout << -1 << endl;
    return 0;
  }
  vector<pair<int, int> > res;
  set<int> ss;
  for (int i = 0; i < n - 1; i++) {
    int p = a[i] - '0', q = a[i + 1] - '0', x;
    x = sign[i];
    if (x && p + x < 10 && p + x >= 0 && q + x < 10 && q + x >= 0) ss.insert(i);
  }
  for (int t = 0; t < 100000; t++) {
    if (ss.empty()) break;
    int i = *ss.begin();
    ss.erase(ss.begin());
    res.push_back(make_pair(i + 1, sign[i]));
    a[i] += sign[i];
    a[i + 1] += sign[i];
    change[i] -= sign[i];
    if (change[i] == 0) sign[i] = 0;
    int p, q, x;
    p = a[i] - '0';
    q = a[i + 1] - '0';
    x = sign[i];
    if (x && p + x < 10 && p + x >= 0 && q + x < 10 && q + x >= 0) ss.insert(i);
    if (i + 1 < n - 1) {
      p = a[i + 1] - '0';
      q = a[i + 2] - '0';
      x = sign[i + 1];
      if (x && p + x < 10 && p + x >= 0 && q + x < 10 && q + x >= 0)
        ss.insert(i + 1);
    }
    if (i - 1 >= 0) {
      p = a[i - 1] - '0';
      q = a[i] - '0';
      x = sign[i - 1];
      if (x && p + x < 10 && p + x >= 0 && q + x < 10 && q + x >= 0)
        ss.insert(i - 1);
    }
  }
  cout << c << endl;
  for (pair<int, int> v : res) cout << v.first << ' ' << v.second << endl;
}
