#include<bits/stdc++.h>
using namespace std;
ifstream fi("DQND.inp");
ofstream fo("DQND.out");
int t=1;
void rev(int64_t x){
  if(x<10)fo<<x<<endl<<t;
  if(x>10){
        fo<<x%10;
        ++t;
        rev(x/10);
  }
}
int main(){
    int n;
    fi>>n;
    rev(n);
}
