#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
const int MX = 100 * 1000 + 7;
const int MAXLEN = 100 * 1000;
vector<pair<int, int> > ans;
int a[MX], b[MX];
long long res = 0;
void print() {
  cout << res << "\n";
  for (int i = 0; i < min(MAXLEN, (int)ans.size()); i++) {
    cout << ans[i].first + 1 << " " << ans[i].second << "\n";
  }
  exit(0);
}
bool ok(int v, int delta) {
  int x = a[v] + delta;
  return x >= 0 && x <= 9;
}
void make(int v, int delta) {
  if (!ok(v, delta) || !ok(v + 1, delta)) {
    make(v + 1, -delta);
  }
  a[v] += delta;
  a[v + 1] += delta;
  if ((int)ans.size() <= MAXLEN) {
    ans.emplace_back(v, delta);
  } else {
    print();
  }
}
long long ca[MX], cb[MX];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  string ss, tt;
  cin >> ss >> tt;
  for (int i = 0; i < n; i++) {
    a[i] = ss[i] - '0';
    b[i] = tt[i] - '0';
    ca[i] = a[i];
    cb[i] = b[i];
  }
  int sma = 0, smb = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      sma += a[i];
      smb += b[i];
    } else {
      sma -= a[i];
      smb -= b[i];
    }
  }
  if (sma != smb) {
    cout << "-1\n";
    return 0;
  }
  for (int i = 0; i + 1 < n; i++) {
    long long diff = cb[i] - ca[i];
    res += abs(diff);
    ca[i] += diff;
    ca[i + 1] += diff;
  }
  for (int i = 0; i + 1 < n; i++) {
    while (a[i] < b[i]) {
      make(i, 1);
    }
    while (a[i] > b[i]) {
      make(i, -1);
    }
  }
  print();
  return 0;
}
