#include <bits/stdc++.h>
using namespace std;
int n;
char buf[100002];
int s[100002];
int t[100002];
int pl[100002];
int neg[100002];
int tmp[100002];
set<int> P;
set<int> N;
vector<pair<int, int> > ans;
int main() {
  cin >> n;
  scanf("%s", buf);
  for (int i = 0; i < n; i++) {
    s[i] = buf[i] - '0';
    tmp[i] = s[i];
  }
  scanf("%s", buf);
  for (int i = 0; i < n; i++) {
    t[i] = buf[i] - '0';
  }
  long long int W = 0;
  for (int i = 0; i + 1 < n; i++) {
    if (tmp[i] == t[i]) continue;
    if (tmp[i] < t[i]) {
      pl[i] = t[i] - tmp[i];
      tmp[i] += pl[i];
      tmp[i + 1] += pl[i];
    } else {
      neg[i] = tmp[i] - t[i];
      tmp[i] -= neg[i];
      tmp[i + 1] -= neg[i];
    }
    W += neg[i];
    W += pl[i];
  }
  for (int i = 0; i < n; i++) {
    if (tmp[i] != t[i]) {
      puts("-1");
      return 0;
    }
  }
  printf("%lld\n", W);
  for (int i = 0; i < n; i++) {
    if (pl[i]) {
      P.insert(i);
    }
  }
  for (int i = 0; i < n; i++) {
    if (neg[i]) {
      N.insert(i);
    }
  }
  int co = 0;
  while (P.size() || N.size()) {
    vector<int> del;
    bool upd = false;
    for (int el : P) {
      while (pl[el] && s[el] < 9 && s[el + 1] < 9) {
        s[el]++;
        s[el + 1]++;
        printf("%d %d\n", el + 1, 1);
        co++;
        if (co == 100000) return 0;
        pl[el]--;
        upd = true;
      }
      if (pl[el] == 0) del.push_back(el);
    }
    for (int z : del) {
      P.erase(z);
    }
    del.clear();
    for (int el : N) {
      while (neg[el] && s[el] > 0 && s[el + 1] > 0) {
        s[el]--;
        s[el + 1]--;
        printf("%d %d\n", el + 1, -1);
        co++;
        if (co == 100000) return 0;
        neg[el]--;
        upd = true;
      }
      if (neg[el] == 0) {
        del.push_back(el);
      }
    }
    for (int z : del) {
      N.erase(z);
    }
    if (upd == false) {
      break;
    }
  }
  if (P.size() || N.size()) {
    puts("-1");
    return 0;
  }
  return 0;
}
