#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000002;
char a[maxn];
char b[maxn];
int cur[maxn];
bool in_que[maxn];
int n;
bool is_ok(int i);
int main() {
  scanf("%d", &n);
  scanf("%s", a + 1);
  scanf("%s", b + 1);
  for (int i = 1; i < n; i++) {
    cur[i] = b[i] - (a[i] + cur[i - 1]);
  }
  if (b[n] - (a[n] + cur[n - 1]) != 0) {
    printf("-1");
    return 0;
  }
  long long sum = 0;
  for (int i = 1; i < n; i++) {
    sum += abs(cur[i]);
  }
  printf("%lld\n", sum);
  queue<int> q;
  for (int i = 1; i < n; i++) {
    if (is_ok(i)) {
      q.push(i);
      in_que[i] = 1;
    }
  }
  int cnt = 100000;
  if (sum < cnt) cnt = sum;
  while (!q.empty()) {
    if (!cnt) break;
    int i = q.front();
    q.pop();
    in_que[i] = 0;
    if (!is_ok(i)) continue;
    if (cur[i] > 0) {
      if (a[i] < '9' && a[i + 1] < '9') {
        printf("%d 1\n", i);
        a[i]++;
        a[i + 1]++;
        cnt--;
        cur[i]--;
      } else
        continue;
    } else if (cur[i] < 0) {
      if ((i == 1 ? a[i] > '1' : a[i] > '0') && a[i + 1] > '0') {
        printf("%d -1\n", i);
        a[i]--;
        a[i + 1]--;
        cnt--;
        cur[i]++;
      } else
        continue;
    } else
      continue;
    if (is_ok(i)) {
      q.push(i);
      in_que[i] = 1;
    }
    if (i > 1 && !in_que[i - 1] && is_ok(i)) q.push(i - 1), in_que[i - 1] = 1;
    if (i < n - 1 && !in_que[i + 1] && is_ok(i))
      q.push(i + 1), in_que[i + 1] = 1;
  }
  return 0;
}
bool is_ok(int i) {
  return 1;
  if (cur[i] == 0) return 0;
  if (cur[i] > 0)
    return a[i] < '9' && a[i + 1] < '9';
  else
    return (i == 1 ? a[i] > '1' : a[i] > '0') && a[i + 1] > '0';
}
