#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool isOn(T mask, T pos) {
  return mask & (1 << pos);
}
template <typename T>
inline int Off(T mask, T pos) {
  return mask ^ (1 << pos);
}
template <typename T>
inline int On(T mask, T pos) {
  return mask | (1 << pos);
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
template <class T>
string toBinary(T n) {
  string ret = "";
  while (n) {
    if (n % 2 == 1)
      ret += '1';
    else
      ret += '0';
    n >>= 1;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long int toLInt(string s) {
  long long int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double toDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
vector<string> token(string str, string deli) {
  char *cstr, *p, *deli_c;
  deli_c = new char[deli.size() + 1];
  cstr = new char[str.size() + 1];
  strcpy(deli_c, deli.c_str());
  strcpy(cstr, str.c_str());
  vector<string> vec;
  p = strtok(cstr, deli_c);
  while (p != NULL) {
    vec.push_back(string(p));
    p = strtok(NULL, deli_c);
  }
  delete[] cstr;
  return vec;
}
template <class T>
inline T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
long long int dp[1000003];
template <class T>
inline T BIGMOD(T n, T m, T mod) {
  long long int ans = 1;
  long long int k = n;
  long long int mm = m;
  if (dp[mm] != -1) {
    return dp[mm];
  }
  while (m) {
    if (m & 1) {
      ans *= k;
      if (ans > mod) ans %= mod;
    }
    k *= k;
    if (k > mod) k %= mod;
    m >>= 1;
  }
  return dp[mm] = ans;
}
template <class T>
T modInverse(T b, T m) {
  return BIGMOD(b, m - 2, m);
}
long long int fastExpo(long long int b, long long int p) {
  long long int res = 1, x = b;
  while (p) {
    if (p & 1) res *= x;
    x *= x;
    p = p >> 1;
  }
  return res;
}
long long int hash_table(char c[]) {
  long long int len = strlen(c);
  long long int hash_value = 0, base = 26, mod = 10000007;
  for (long long int i = 0; i < len; i++) {
    long long int n = c[i] - 64;
    long long int power = BIGMOD(base, i, mod);
    n = ((n % mod) * (power % mod)) % mod;
    hash_value = ((hash_value % mod) + (n % mod)) % mod;
  }
  return hash_value;
}
double dist(int x, int y, int x1, int y1) {
  return sqrt(((x1 - x) * (x1 - x)) + ((y1 - y) * (y1 - y)));
}
void makelengthequal(int p, char *a, char *b) {
  int l1, l2;
  l1 = strlen(a);
  l2 = strlen(b);
  int dif = (p - l1);
  {
    for (int j = l1 - 1; j >= 0; j--) {
      a[j + dif] = a[j];
    }
    for (int i = 0; i < dif; i++) a[i] = '0';
  }
  a[p] = '\0';
  dif = (p - l2);
  {
    for (int j = l2 - 1; j >= 0; j--) {
      b[j + dif] = b[j];
    }
    for (int i = 0; i < dif; i++) b[i] = '0';
  }
  b[p] = '\0';
  cout << a << endl << b << endl;
}
vector<long long int> v;
int main() {
  string s, ss;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> s >> ss;
  memset(dp, -1, sizeof(dp));
  int cnt = 0;
  long long int hash_value_ss = 0;
  for (int i = ss.size() - 1; i >= 0; i--) {
    long long int y = BIGMOD(25, cnt, 1000000007);
    long long int x = (ss[i] - 'a' + 1);
    long long int r = (x * y) % 1000000007;
    hash_value_ss += r;
    hash_value_ss %= 1000000007;
    cnt++;
  }
  cnt = 0;
  long long int h = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    long long int y = BIGMOD(25, cnt, 1000000007);
    long long int x = (s[i] - 'a' + 1);
    long long int r = (x * y) % 1000000007;
    h += r;
    h %= 1000000007;
    cnt++;
    v.push_back(h);
  }
  long long int fr_h = 0;
  cnt = s.size() - 1;
  cnt--;
  vector<int> rs;
  int k = 0;
  for (int i = ((int)(v.size())) - 2; i >= 0; i--) {
    long long int fr_t = fr_h + v[i];
    fr_t %= 1000000007;
    if (fr_t == hash_value_ss) {
      rs.push_back(k + 1);
    }
    long long int x = s[k] - 'a' + 1;
    long long int y = BIGMOD(25, cnt, 1000000007);
    long long int r = (x * y) % 1000000007;
    fr_h += r;
    fr_h %= 1000000007;
    k++;
    cnt--;
  }
  if (fr_h == hash_value_ss) {
    rs.push_back(k + 1);
  }
  printf("%d\n", rs.size());
  for (int i = 0; i < rs.size(); i++) {
    if (i != 0) printf(" ");
    printf("%d", rs[i]);
  }
  printf("\n");
}
