#include <bits/stdc++.h>
using namespace std;
int n, need[100005];
string a, b;
void load() {
  cin >> n;
  cin >> a >> b;
}
bool can(int pos, int val) {
  if (val == 0) return 0;
  if (val > 0) {
    return (pos == 0 ? a[pos] > '1' : a[pos] > '0') && a[pos + 1] > '0';
  }
  return a[pos] < '9' && a[pos + 1] < '9';
}
void solve() {
  long long diff = 0, ans = 0;
  set<int> cans;
  for (int i = 0; i < n - 1; i++) {
    int cur = (a[i] - '0') - (b[i] - '0' + diff);
    need[i] = cur;
    ans += abs(cur);
    if (can(i, cur)) {
      cans.insert(i);
    }
    diff = cur;
  }
  if (a[n - 1] - '0' != b[n - 1] - '0' + diff) {
    cout << -1 << endl;
    return;
  }
  cout << ans << endl;
  for (int i = 0; i < 100000 && cans.size() > 0; i++) {
    int pos = *cans.begin();
    cans.erase(cans.begin());
    int pcan = (pos > 0 && can(pos - 1, need[pos - 1]));
    int ncan = (pos < n - 1 && can(pos + 1, need[pos + 1]));
    cout << pos + 1 << " " << (need[pos] > 0 ? -1 : 1) << endl;
    if (need[pos] > 0) {
      a[pos]--;
      a[pos + 1]--;
    } else {
      a[pos]++;
      a[pos + 1]++;
    }
    need[pos] += (need[pos] > 0 ? -1 : 1);
    if (can(pos, need[pos])) {
      cans.insert(pos);
    }
    if (pos > 0) {
      if (pcan == 0 && can(pos - 1, need[pos - 1])) {
        cans.insert(pos - 1);
      } else if (pcan == 1 && !can(pos - 1, need[pos - 1])) {
        cans.erase(pos - 1);
      }
    }
    if (pos < n - 1) {
      if (ncan == 0 && can(pos + 1, need[pos + 1])) {
        cans.insert(pos + 1);
      } else if (ncan == 1 && !can(pos + 1, need[pos + 1])) {
        cans.erase(pos + 1);
      }
    }
  }
}
int main() {
  load();
  solve();
}
