#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100000;
long long n;
string s1, s2;
long long sum;
long long a[maxn + 3], b[maxn + 3], c[maxn + 3];
long long tt;
void dfs(long long i, long long y) {
  if (!y) return;
  a[i] += y;
  a[i + 1] += y;
  if (a[i + 1] > 9) dfs(i + 1, 9 - a[i + 1]);
  if (a[i + 1] < 0) dfs(i + 1, -a[i + 1]);
  for (long long k = 1; k <= abs(y); k++) {
    tt++;
    cout << i << " " << (y > 0 ? 1 : -1) << endl;
    if (tt >= maxn) exit(0);
  }
}
int main() {
  cin >> n >> s1 >> s2;
  s1 = " " + s1;
  s2 = " " + s2;
  for (int i = 1; i < s1.size(); i++) a[i] = s1[i] - '0', b[i] = a[i];
  for (int i = 1; i < s2.size(); i++) c[i] = s2[i] - '0';
  for (int i = 1; i < n; i++) {
    long long t = c[i] - b[i];
    sum += abs(t);
    b[i + 1] += t;
  }
  if (c[n] != b[n])
    cout << -1 << endl;
  else {
    cout << sum << endl;
    for (int i = 1; i <= n; i++) dfs(i, c[i] - a[i]);
  }
  return 0;
}
