#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
char s[maxn + 5];
int n, a[maxn + 5], b[maxn + 5];
int hh[maxn + 5];
long long cnt = 0;
vector<pair<int, int>> ans;
bool Chk() {
  int now = 0;
  for (int i = 1; i < n; ++i) {
    now = b[i] - a[i] - now;
    cnt += abs(now);
  }
  return a[n] + now == b[n];
}
void Insert(int p, int v) {
  ans.push_back(make_pair(p, v));
  if (ans.size() == maxn) {
    printf("%lld\n", cnt);
    for (int i = 0; i < ans.size(); ++i)
      printf("%d %d\n", ans[i].first, ans[i].second);
    exit(0);
  }
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) a[i] = s[i] - '0';
  scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) b[i] = s[i] - '0';
  if (!Chk()) exit(puts("-1") * 0);
  for (int i = 1; i < n; ++i) {
    if (a[i] == b[i]) continue;
    int p = i, v;
    if (a[i] < b[i])
      v = 1;
    else
      v = -1;
    hh[p] = v;
    while (1) {
      if (a[p + 1] + hh[p] > 9) {
        hh[p + 1] = -hh[p];
        ++p;
      } else if (a[p + 1] + hh[p] < 0) {
        hh[p + 1] = -hh[p];
        ++p;
      } else
        break;
    }
    for (int k = p; k >= i; --k) {
      Insert(k, hh[k]);
      a[k] += hh[k], a[k + 1] += hh[k];
    }
    --i;
  }
  printf("%lld\n", cnt);
  for (int i = 0; i < ans.size(); ++i)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
