BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
        ArrayList<String> l = new ArrayList<String>();

        for(int i=0; i<10; i++)
          String ss = b.readLine();
          //int size;
          //add an element on index 0 in the list L
          l.add(0, ss);
          //logic assumption: if value has been added then it size become 1.
         if (l.size()>=1)
              //logic assumption: now pushing the value to next element i.e 1 for i=0
             //logic assumption: removing the previous value stored at index 0;


       for(int i=0; i<l.size(); i++)