#include <deque>
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{
string target, stamp;
cin >> target >> stamp;
deque<int> order1, order2, order3, order4, order5;
for(int i = 0; i <= target.size() - stamp.size(); i++)
{
if(stamp[0] == target[i])
order2.push_back(i);
}
for(int i = target.size() - 1; i >= stamp.size(); i--)
{
if(stamp[stamp.size() - 1] == target[i])
order1.push_back(i - stamp.size() + 1);
}
for(int i = 0; i <= target.size() - stamp.size(); i++)
{
bool flag = true;
for(int j = 0; j < stamp.size(); j++)
{
if(target[i+j] != stamp[j])
{
flag = false;
break;
}
}
if(flag)
order3.push_back(i);
}
deque<int> order;
for(int p : order1) order.push_back(p);
for(int p : order2) order.push_back(p);
for(int p : order3) order.push_back(p);
string comp(target.size(), ' ');
for(int p : order)
{
for(int i = 0; i < stamp.size(); i++)
comp[p+i] = stamp[i];
}
//cout << comp << endl;
for(int i = 0; i <= target.size() - stamp.size(); i++)
{
int p = 0;
string w;
for(; comp[i+p] != target[i+p] && p < stamp.size(); p++)
w += target[i+p];
if(p)
{
int q = 0;
a:
for(int j = 0; j + q < stamp.size() && j < w.size(); j++)
{
if(stamp[j+q] != w[j])
{
q++;
goto a;
}
}
bool flag = true;
for(int j = 0; j < p && i + j < n; j++)
{
if(comp[i + j] != ' ')
{
flag = false;
break;
}
}
(flag ? order5 : order4).push_back(i - q);
}
i += p;
}
order.clear();
for(int p : order5) order.push_back(p);
for(int p : order1) order.push_back(p);
for(int p : order4) order.push_back(p);
for(int p : order2) order.push_back(p);
for(int p : order3) order.push_back(p);
for(int p : order)
{
for(int i = 0; i < stamp.size(); i++)
comp[p+i] = stamp[i];
}
//cout << comp << endl;
if(comp != target)
{
cout << "-1" << endl;
return 0;
}
cout << order.size() << endl;
for(int p : order)
cout << p+1 << " ";
cout << endl;
return 0;
}