#include <bits/stdc++.h>
using namespace std;
string a, b;
int ccount;
void drop(int pos, int coin) {
  if (coin == 1 && a[pos + 1] == '9') drop(pos + 1, -1);
  if (coin == -1 && a[pos + 1] == '0') drop(pos + 1, 1);
  if (!ccount) exit(0);
  ccount--;
  a[pos] += coin;
  a[pos + 1] += coin;
  cout << pos + 1 << " " << coin << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int c[n], flag = 1;
  cin >> a;
  cin >> b;
  long long ans = 0;
  c[0] = (int)(b[0] - a[0]);
  ans += abs(c[0]);
  for (int i = 1; i < n - 1; i++) {
    c[i] = (int)(b[i] - a[i] - c[i - 1]);
    ans += abs(c[i]);
  }
  if (a[n - 1] + c[n - 2] != b[n - 1])
    cout << -1 << endl;
  else {
    cout << ans << endl;
    ccount = 100000;
    for (int i = 0; i < n - 1; i++) {
      while (a[i] < b[i]) {
        drop(i, 1);
      }
      while (a[i] > b[i]) {
        drop(i, -1);
      }
    }
  }
  return 0;
}
