#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &v) {
  os << '{';
  string sep;
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
void dbg_out() { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
long long ppow[(long long)(1e6) + 88];
long long pinv[(long long)(1e6) + 88];
long long H[(long long)(1e6) + 88];
long long power(long long b, long long p) {
  long long r = 1ll;
  b = b % (long long)(1e9 + 7);
  while (p) {
    if (p & 1) r = (r * b) % (long long)(1e9 + 7);
    b = (b * b) % (long long)(1e9 + 7);
    p >>= 1;
  }
  return r;
}
void pre() {
  ppow[0] = pinv[0] = 1;
  for (int i = 1; i < (long long)(1e6); i++) {
    ppow[i] = (ppow[i - 1] * 39) % (long long)(1e9 + 7);
    pinv[i] = power(ppow[i], (long long)(1e9 + 7) - 2);
  }
}
long long getHash(string &s) {
  long long h = 0;
  for (int i = 0; i < s.size(); i++) {
    h = (h + (s[i] - 'a' + 1) * ppow[i]) % (long long)(1e9 + 7);
  }
  return h;
}
void getHashTable(string &s) {
  H[0] = 0;
  for (int i = 0; i < s.size(); i++) {
    H[i + 1] = (H[i] + (s[i] - 'a' + 1) * ppow[i]) % (long long)(1e9 + 7);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string a, b;
  cin >> a >> b;
  pre();
  getHashTable(a);
  long long h = getHash(b);
  vector<int> r;
  for (int i = 0; i < a.size(); i++) {
    long long x = (H[i] + ((H[a.size()] - H[i + 1] + (long long)(1e9 + 7)) %
                           (long long)(1e9 + 7) * pinv[1]) %
                              (long long)(1e9 + 7)) %
                  (long long)(1e9 + 7);
    if (x == h) r.push_back(i + 1);
  }
  if (r.size() == 0)
    cout << 0 << endl;
  else {
    cout << r.size() << endl;
    for (int x : r) cout << x << " ";
  }
  return 0;
}
