#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1;
int n, cnt, aa[maxn], bb[maxn], c[maxn];
bool flag = true;
vector<pair<int, int>> res;
void add(int p);
void sub(int p);
int main() {
  int n;
  string a, b;
  cin >> n >> a >> b;
  a = '#' + a;
  b = '#' + b;
  for (int i = 1; i <= n; ++i) {
    c[i] = aa[i] = a[i] - '0';
    bb[i] = b[i] - '0';
  }
  long long res = 0;
  for (int i = 1; i != n; ++i) {
    res += abs(bb[i] - c[i]);
    c[i + 1] += bb[i] - c[i];
  }
  if (bb[n] != c[n]) return cout << -1 << endl, 0;
  cout << res << '\n';
  for (int i = 1; i != n; ++i) {
    while (aa[i] < bb[i]) add(i);
    while (aa[i] > bb[i]) sub(i);
  }
}
void add(int p) {
  if (aa[p + 1] == 9) sub(p + 1);
  if (++cnt == maxn) exit(0);
  cout << p << " 1\n";
  ++aa[p];
  ++aa[p + 1];
}
void sub(int p) {
  if (aa[p + 1] == 0) add(p + 1);
  if (++cnt == maxn) exit(0);
  cout << p << " -1\n";
  --aa[p];
  --aa[p + 1];
}
