#include <bits/stdc++.h>
using namespace std;
int n;
long long ans;
string a, b;
vector<pair<int, int> > seq;
void lowerize(int);
void upperize(int x) {
  assert(x < n);
  if (a[x] == '9')
    lowerize(x + 1);
  else
    a[x]++;
  seq.push_back(make_pair(x, 1));
}
void lowerize(int x) {
  assert(x < n);
  if (a[x] == '0')
    upperize(x + 1);
  else
    a[x]--;
  seq.push_back(make_pair(x, -1));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  int debt = 0;
  for (int i = 0; i < n; i++) {
    int cur = (a[i] - '0');
    cur += debt;
    debt = (b[i] - '0') - cur;
    ans += abs(debt);
  }
  if (debt != 0) {
    cout << -1;
    return 0;
  }
  cout << ans << '\n';
  for (int i = 0; i < n; i++) {
    while (a[i] < b[i]) {
      a[i]++;
      upperize(i + 1);
      if ((int)seq.size() >= (int)1e5) break;
    }
    while (a[i] > b[i]) {
      a[i]--;
      lowerize(i + 1);
      if ((int)seq.size() >= (int)1e5) break;
    }
    if ((int)seq.size() >= (int)1e5) break;
  }
  if ((int)seq.size() >= (int)1e5) seq.erase(seq.begin() + (int)1e5, seq.end());
  for (const auto& e : seq) cout << e.first << ' ' << e.second << '\n';
  return 0;
}
