#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210000;
int n;
int a[MAXN];
int b[MAXN];
long long ad[MAXN];
int df[MAXN];
const int C = 100000;
vector<pair<int, int>> mv;
void dfs1(int v) {
  if (ad[v] > 0) {
    if (a[v + 1] == 9) dfs1(v + 1);
    ++a[v];
    ++a[v + 1];
    mv.emplace_back(v, 1);
    --ad[v];
  } else {
    if (a[v + 1] == 0) dfs1(v + 1);
    --a[v];
    --a[v + 1];
    mv.emplace_back(v, -1);
    ++ad[v];
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    a[i] = c - '0';
  }
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    b[i] = c - '0';
  }
  long long ans = 0;
  for (int i = 0; i + 1 < n; ++i) {
    int go = b[i] - (a[i] + df[i]);
    ad[i] = go;
    df[i + 1] = go;
    ans += abs(go);
  }
  if (a[n - 1] + df[n - 1] != b[n - 1]) {
    cout << -1 << "\n";
    return 0;
  }
  for (int i = 0; i + 1 < n; ++i) {
    while (ad[i] != 0 && mv.size() < C) dfs1(i);
  }
  if (mv.size() > C) mv.resize(C);
  cout << ans << "\n";
  for (auto p : mv) cout << p.first + 1 << " " << p.second << "\n";
  return 0;
}
