#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int b[maxn];
vector<pair<int, int> > res;
bool stopped;
void doDec(int i, int n);
void doInc(int i, int n) {
  if (stopped) return;
  a[i]++;
  if (i + 1 < n) {
    if (a[i + 1] == 9) {
      doDec(i + 1, n);
    }
    a[i + 1]++;
  }
  res.push_back(pair<int, int>(i, 1));
  if (res.size() > 1e5) stopped = true;
}
void doDec(int i, int n) {
  if (stopped) return;
  a[i]--;
  if (i + 1 < n) {
    if (a[i + 1] == 0) {
      doInc(i + 1, n);
    }
    a[i + 1]--;
  }
  res.push_back(pair<int, int>(i, -1));
  if (res.size() > 1e5) stopped = true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n = 0;
  cin >> n;
  string s;
  string s1;
  cin >> s >> s1;
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
    b[i] = s1[i] - '0';
  }
  int t = b[0] - a[0];
  long long res1 = 0;
  res1 += abs(t);
  for (int i = 1; i < n - 1; i++) {
    t = b[i] - (t + a[i]);
    res1 += abs(t);
  }
  if (t + a[n - 1] != b[n - 1]) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    while (a[i] < b[i] && !stopped) {
      doInc(i, n);
    }
    while (a[i] > b[i] && !stopped) {
      doDec(i, n);
    }
  }
  int sl = min((int)res.size(), 100000);
  cout << res1 << endl;
  for (int i = 0; i < sl; i++)
    cout << res[i].first + 1 << " " << res[i].second << endl;
  return 0;
}
