#include <bits/stdc++.h>
using namespace std;
const int maxn = 100002;
int a[maxn], b[maxn];
int f[maxn];
char s1[maxn], s2[maxn];
int t1[maxn], t2[maxn];
int n, cnt;
bool is_in[maxn];
int main() {
  scanf("%d", &n);
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  for (int i = 1; i <= n; i++) {
    t1[i] = s1[i] - '0';
    t2[i] = s2[i] - '0';
  }
  for (int i = 1; i <= n; i++) {
    a[i] = s1[i] - '0';
  }
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    b[i] = t2[i] - t1[i];
    t1[i] += b[i];
    t1[i + 1] += b[i];
    ans += abs(b[i]);
  }
  if (t1[n] != t2[n]) {
    printf("-1");
    return 0;
  }
  printf("%lld\n", ans);
  for (int i = 1; i < n; i++) {
    f[i] = b[i] > 0 ? 1 : -1;
  }
  int c = min(ans, (long long)100000);
  int cur = 1;
  while (c--) {
    while (1) {
      if (b[cur] < 0 && a[cur] > 0 && a[cur + 1] > 0) {
        printf("%d -1\n", cur);
        b[cur]++;
        a[cur]--;
        a[cur + 1]--;
        break;
      }
      if (b[cur] > 0 && a[cur] < 9 && a[cur + 1] < 9) {
        printf("%d 1\n", cur);
        b[cur]--;
        a[cur]++;
        a[cur + 1]++;
        break;
      }
      cur++;
    }
    if (cur > 1) cur--;
  }
  return 0;
}
