#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000;
int n, tag[MAX + 5], cnt[MAX + 5], a[MAX + 5], b[MAX + 5];
long long ans;
char s[MAX + 5];
int amin(int a, int b) { return a > b ? b : a; }
struct node {
  int num, op;
  node(int num, int op) : num(num), op(op) {}
  node() : num(0), op(0) {}
};
vector<node> p;
bool sub_dfs(int num);
bool add_dfs(int num);
bool sub_dfs(int num) {
  if (num == n) return false;
  if (tag[num + 1] + b[num + 1] != 0) {
    p.push_back(node(num, -1));
    tag[num + 1]--;
    tag[num]--;
    return true;
  } else {
    if (add_dfs(num + 1)) {
      p.push_back(node(num, -1));
      tag[num + 1]--;
      tag[num]--;
      return true;
    }
  }
  return false;
}
bool add_dfs(int num) {
  if (num == n) return false;
  if (tag[num + 1] + b[num + 1] != 9) {
    p.push_back(node(num, 1));
    tag[num + 1]++;
    tag[num]++;
    return true;
  } else {
    if (sub_dfs(num + 1)) {
      p.push_back(node(num, 1));
      tag[num + 1]++;
      tag[num]++;
      return true;
    }
  }
  return false;
}
int main() {
  int i, flag;
  scanf("%d", &n);
  scanf("%s\n", s);
  for (i = 0; i < n; i++) {
    a[i + 1] = s[i] - '0';
  }
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    b[i + 1] = s[i] - '0';
  }
  for (i = 1; i <= n; i++) {
    tag[i] = cnt[i] = a[i] - b[i];
  }
  flag = 1;
  if (b[1] == 0) {
    printf("-1\n");
    return 0;
  }
  for (i = 1; i < n; i++) {
    while (tag[i] > 0 && p.size() < MAX) {
      if (!sub_dfs(i)) {
        flag = 0;
        break;
      }
    }
    if (flag == 0) break;
    while (tag[i] < 0 && p.size() < MAX) {
      if (!add_dfs(i)) {
        flag = 0;
        break;
      }
    }
    if (flag == 0) break;
  }
  if (!flag) {
    printf("-1\n");
    return 0;
  }
  for (i = 1; i < n; i++) {
    if (!cnt[i]) continue;
    cnt[i + 1] -= cnt[i];
    if (cnt[i] < 0)
      ans += cnt[i] * (-1);
    else
      ans += cnt[i];
  }
  if (cnt[n] != 0) {
    printf("-1");
    return 0;
  }
  printf("%I64d\n", ans);
  for (i = 0; i < amin(p.size(), MAX); i++) {
    printf("%d %d\n", p[i].num, p[i].op);
  }
  return 0;
}
