#include <bits/stdc++.h>
using namespace std;
long long p[500005];
long long sz[500005];
long long root(long long x) {
  if (x == p[x]) return x;
  return p[x] = root(p[x]);
}
void unite(long long x, long long y) {
  x = root(x);
  y = root(y);
  if (x != y) {
    if (sz[x] > sz[y]) {
      p[y] = x;
      sz[x] += sz[y];
    } else {
      p[x] = y;
      sz[y] += sz[x];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  string s, t;
  cin >> n >> s >> t;
  vector<pair<char, char> > v;
  for (int i = 0; i < 26; i++) {
    p[i] = i;
    sz[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != t[i]) {
      int u = s[i] - 'a';
      int vv = t[i] - 'a';
      if (root(u) != root(vv)) {
        unite(u, vv);
        v.push_back({s[i], t[i]});
      }
    }
  }
  cout << v.size() << endl;
  for (auto x : v) cout << x.first << " " << x.second << endl;
}
