#include <bits/stdc++.h>
using namespace std;
const int N = 2000000;
int n;
string a, b;
int aa[N], bb[N], del[N];
int main() {
  cin >> n;
  cin >> a >> b;
  for (int i = 1; i < n + 1; ++i) {
    aa[i] = a[i - 1] - '0';
    bb[i] = b[i - 1] - '0';
  }
  long long ans = 0;
  for (int i = 1; i < n + 1; ++i) {
    del[i] = bb[i] - aa[i] - del[i - 1];
    ans += abs(del[i]);
  }
  if (del[n]) {
    printf("-1\n");
    return 0;
  }
  printf("%lld\n", ans);
  ans = min(ans, 100000ll);
  int op_cur = 1;
  int cur = 1;
  while (ans) {
    while (!del[cur]) cur++;
    op_cur = max(op_cur, cur);
    while ((del[op_cur] > 0 && aa[op_cur + 1] == 9) ||
           (del[op_cur] < 0 && aa[op_cur + 1] == 0))
      op_cur++;
    assert(del[op_cur]);
    int tmp = 0;
    if (del[op_cur] > 0) {
      printf("%d 1\n", op_cur);
      tmp = 1;
    } else {
      printf("%d -1\n", op_cur);
      tmp = -1;
    }
    aa[op_cur] += tmp;
    aa[op_cur + 1] += tmp;
    del[op_cur] -= tmp;
    op_cur--;
    ans--;
  }
}
