#include <bits/stdc++.h>
using ll = long long;
using namespace std;
template <typename... Args>
void read(Args &...args) {
  ((cin >> args), ...);
}
template <typename... Args>
void write(Args... args) {
  ((cout << args << " "), ...);
}
template <typename... Args>
void writeln(Args... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
template <typename T>
void read(vector<T> &a) {
  for (auto &ele : a) cin >> ele;
}
template <typename T>
void writeln(vector<T> &a) {
  for (auto &ele : a) cout << ele << ' ';
  cout << "\n";
}
const pair<int, int> dxy[] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
const pair<int, int> fxy[] = {{-1, 0}, {1, 0},   {0, -1}, {0, 1},
                              {1, 1},  {-1, -1}, {-1, 1}, {1, -1}};
int link[26];
int len[26];
int find(int x) {
  while (x != link[x]) x = link[x];
  return x;
}
void unite(int a, int b) {
  a = find(a);
  b = find(b);
  if (len[a] < len[b]) swap(a, b);
  len[a] += len[b];
  link[b] = a;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  int n;
  read(n);
  string s, t;
  read(s, t);
  for (int i = 0; i < 26; ++i) {
    link[i] = i;
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] != t[i]) {
      int x = s[i] - 'a';
      int y = t[i] - 'a';
      if (find(x) != find(y)) {
        unite(x, y);
      }
    }
  }
  set<pair<int, int> > res;
  for (int i = 0; i < 26; ++i) {
    int tmp = i;
    while (link[tmp] != tmp) {
      int x = link[i];
      int y = i;
      if (x > y) swap(x, y);
      res.emplace(x, y);
      tmp = link[tmp];
    }
  }
  cout << res.size() << '\n';
  for (auto it = res.begin(); it != res.end(); ++it) {
    char x = it->first + 'a';
    char y = it->second + 'a';
    cout << x << ' ' << y << '\n';
  }
  cout << '\n';
  return 0;
}
