#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, a[N], b[N], tmp[N], suma, sumb;
long long ans;
char x;
void solve(int x, int val) {
  if (!ans) return;
  if (a[x + 1] + val > 9 || a[x + 1] + val < 0) solve(x + 1, -val);
  if (!ans) return;
  a[x] += val;
  a[x + 1] += val;
  ans--;
  int v = abs(val);
  printf("%d %d\n", x, val / v);
  return;
}
int main() {
  scanf("%d", &n);
  getchar();
  for (int i = 1; i <= n; i++) x = getchar(), a[i] = x - '0', tmp[i] = a[i];
  getchar();
  for (int i = 1; i <= n; i++) x = getchar(), b[i] = x - '0';
  getchar();
  for (int i = 1, e; i < n; i++)
    e = b[i] - tmp[i], tmp[i] += e, tmp[i + 1] += e, ans += abs(e);
  if (tmp[n] != b[n]) {
    puts("-1");
    return 0;
  }
  cout << ans << endl;
  ans = min(ans, 1ll * 100000);
  for (int i = 1; i < n && ans > 0; i++) {
    while (a[i] != b[i] && ans > 0) solve(i, (b[i] - a[i]) / abs(b[i] - a[i]));
  }
  return 0;
}
