#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long MAXN = 1123456;
const long long N = 1e5;
const long long inf = 3e18;
mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());
template <typename T>
void vout(T s) {
  cout << s << endl;
  exit(0);
}
string a, b;
long long res = 0;
vector<pair<long long, long long> > ans;
long long n;
void try_dec(long long pos);
void try_inc(long long pos);
void try_dec(long long pos) {
  if (pos == n) vout(-1);
  if ((int)ans.size() == N) {
    for (auto i : ans) cout << i.first + 1 << " " << i.second << "\n";
    exit(0);
  }
  if (a[pos] == '0') {
    try_inc(pos + 1);
  }
  if ((int)ans.size() < N) ans.push_back({pos - 1, -1});
  a[pos]--;
  a[pos - 1]--;
}
void try_inc(long long pos) {
  if (pos == n) vout(-1);
  if ((int)ans.size() == N) {
    for (auto i : ans) cout << i.first + 1 << " " << i.second << "\n";
    exit(0);
  }
  if (a[pos] == '9') {
    try_dec(pos + 1);
  }
  if ((int)ans.size() < N) ans.push_back({pos - 1, 1});
  a[pos]++;
  a[pos - 1]++;
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> a >> b;
  long long Sa, Sb;
  Sa = Sb = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2)
      Sa += a[i] - '0';
    else
      Sa -= a[i] - '0';
    if (i % 2)
      Sb += b[i] - '0';
    else
      Sb -= b[i] - '0';
  }
  if (Sa != Sb || b[0] == '0') vout("-1");
  long long delta = 0;
  for (int i = 0; i < n; i++) {
    long long nw = a[i] + delta;
    res += abs(nw - b[i]);
    delta = b[i] - nw;
  }
  cout << res << "\n";
  for (int i = 0; i < n; i++) {
    while (a[i] < b[i]) {
      try_inc(i + 1);
    }
    while (a[i] > b[i]) {
      try_dec(i + 1);
    }
  }
  for (auto i : ans) cout << i.first + 1 << " " << i.second << "\n";
  return 0;
}
