#include <iostream>
using namespace std;
int n, a, b, c, d, nr;
int main()
{
cin >> n;
a = n / 1000;
b = (n / 100) % 10;
c = (n / 10) % 10;
d = n % 10;
//punctul a)
nr = b*100 + c * 10 + d;
cout << nr << "\n";
//punctul b)
nr = a*100 + b * 10 + c;
cout << nr << "\n";
//punctul c)
nr = a*10 + b;
cout << nr;
return 0;
}