#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
char s[N], t[N];
int n;
long long ans, res;
void dfs(int x, int op) {
  if (!isdigit(s[x + 1] + op)) dfs(x + 1, -op);
  if (ans-- > 0) s[x] += op, s[x + 1] += op, cout << x + 1 << ' ' << op << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s >> t;
  for (int i = 0; i < n; ++i) ans += abs(res = s[i] - t[i] - res);
  if (res) {
    cout << -1 << '\n';
    return 0;
  }
  cout << ans << '\n';
  ans = min(ans, 100000ll);
  for (int i = 0; i < n; ++i)
    while (ans > 0 && s[i] != t[i]) dfs(i, s[i] > t[i] ? -1 : 1);
  return 0;
}
