#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long __gcd(long long a, long long b) {
  while (a != 0) {
    long long __t = b % a;
    b = a;
    a = __t;
  }
  return b;
}
unsigned kol;
void push(vector<int>& a, vector<int>& d, unsigned p) {
  if (kol >= 1e5) return;
  if (d[p] > 0) {
    if (a[p + 1] == 9) push(a, d, p + 1);
    if (kol >= 1e5) return;
    cout << p + 1 << " " << 1 << endl;
    kol++;
    a[p]++;
    a[p + 1]++;
    d[p]--;
  } else if (d[p] < 0) {
    if (a[p + 1] == 0) push(a, d, p + 1);
    if (kol >= 1e5) return;
    cout << p + 1 << " " << -1 << endl;
    kol++;
    a[p]--;
    a[p + 1]--;
    d[p]++;
  }
}
int main() {
  cin.tie();
  cout.tie();
  cerr.tie();
  ios_base::sync_with_stdio(false);
  unsigned N;
  cin >> N;
  vector<int> a, b;
  {
    string sa, sb;
    cin >> sa >> sb;
    for (auto& c : sa) a.push_back(c - '0');
    for (auto& c : sb) b.push_back(c - '0');
  }
  vector<int> ca = a;
  long long cnt = 0;
  vector<int> d(N - 1);
  for (unsigned i = 0; i + 1 < N; i++) {
    d[i] = b[i] - a[i];
    cnt += abs(d[i]);
    a[i] += d[i];
    a[i + 1] += d[i];
  }
  if (a != b) {
    cout << -1;
    return 0;
  }
  cout << cnt << endl;
  for (unsigned i = 0; i + 1 < N && kol < 1e5; i++)
    while (d[i] && kol < 1e5) push(ca, d, i);
  return 0;
}
