#include <bits/stdc++.h>
using namespace std;
template <class X, class Y>
void amax(X &x, const Y &y) {
  if (x < y) x = y;
}
template <class X, class Y>
void amin(X &x, const Y &y) {
  if (x > y) x = y;
}
const int INF = 1e9 + 10;
const long long INFL = (long long)1e18 + 10;
const int LIMIT = 1e5;
int n;
string sa, sb;
bool found;
vector<int> a, b;
vector<pair<int, int> > trace;
long long calc_cost(int i, int c) {
  if (i == n - 1) {
    if (a[i] + c != b[i]) found = false;
    return 0;
  }
  int nc = b[i] - (a[i] + c);
  return abs(nc) + calc_cost(i + 1, nc);
}
void ensure_add(int i, int x) {
  if (i == n - 1) {
    found = false;
    return;
  }
  if (a[i + 1] + x > 9)
    ensure_add(i + 1, -1);
  else if (a[i + 1] + x < 0)
    ensure_add(i + 1, 1);
  a[i] += x;
  a[i + 1] += x;
  trace.push_back(make_pair(i + 1, x));
}
void get_trace(int i) {
  if (i == n - 1 || ((int)(trace).size()) >= LIMIT) return;
  if (a[i] == b[i]) {
    get_trace(i + 1);
    return;
  }
  int x = b[i] - a[i] > 0 ? 1 : -1;
  ensure_add(i, x);
  get_trace(i);
}
void process() {
  cin >> n >> sa >> sb;
  a.reserve(n);
  b.reserve(n);
  for (int i = 0; i < n; i++) {
    a[i] = sa[i] - '0';
    b[i] = sb[i] - '0';
  }
  found = true;
  long long res = calc_cost(0, 0);
  get_trace(0);
  if (!found)
    cout << -1;
  else {
    cout << res << '\n';
    for (int i = 0; i < min(LIMIT, ((int)(trace).size())); i++) {
      cout << trace[i].first << " " << trace[i].second << '\n';
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  process();
}
