import java.util.*;

public class Solution 
{
    static boolean hasReadjustChain=false;
    static boolean hasStore=false;
    static String currentOutcome="";
    static boolean hasTransitionOccurred=false;
    static boolean replicateNumber=false;
    static String previousPreviousOutcome="";
    static int transitionEvents;
    static String previousOutcome="";
    static List<String> sm = new ArrayList<>();
    static String standaloneTemp="";
    static final float epsilon = 0.0005f;
    static boolean hasAdjust=false;
    static int tickerCounter=0;
    static int ascendingChainsComplete;
    static int descendingChainsComplete;
    static int standaloneCount;
    static String ticker="";
    static int ascendingCounter;
    static int descendingCounter;
    static boolean isStandalone=false;
    static float difference=0.1f;
    static boolean hasStandaloneAfter=true;
    static String potentialfurtherAscendingBeyondThisStart="";
    static String potentialfurtherAscendingBeyondThisEnd="";
    static boolean hasTransition=false;
    
    static int counter = 0;
    
    //************ALL DOCUMENTED TEST CASES**********
    //Ascending
    //static float[] nums = new float[]{0f,2f,3f,4f,6f,8f,9f};   //Test case 1    PASS             
    //static float[] nums = new float[]{-1f};   //Test case 2             PASS             
    //static float[] nums = new float[]{0f};   //Test case 3       PASS                    
    //static float[] nums = new float[]{0,1f,2,4f,5,7f};   //Test case 4    PASS               
        
    //Descending
    //static float[] nums = float int[]{9f,8f,6f,4f,3f,2f,0f};    PASS            
    //static float[] nums = new float[]{-1f};                PASS             
    //static float[] nums = new float[]{0f};          PASS                    
    //static float[] nums = new float[]{7f,5f,4f,2f,1f,0f};      PASS 
        
    //For some reason, no test cases above went through junction 8. All others are valid.
    //So these were new devised cases.....
    //static float[] nums = new float[]{0f,1f,2f,4f,5f,7f,8f,10f,14f};   //Test case 4    PASS            
    //static float[] nums = new float[]{0f,2f,4f,5f,7f,8f,10f,14f,17f,19f,23f,24f,25f,26f,35f,42f,43f,44f};  PASS     
    //static float[] nums = new float[]{5f,4f,3f,4f,5f,7f,6f,10f,14f,17f,19f,23f,24f,25f,26f,35f,42f,47f,60f,61f};  PASS
    //static float[] nums = new float[]{7f,6f,9f,3f,5f,8f};
        
    //Merging both ascending and descending code
    //static float[] nums = new float[]{5f,4f,3f,4f,5f,6f,8f,8f};   PASS
    //static float[] nums = new float[]{5f,4f,3f,4f,5f,7f,6f,5f,10f,14f,17f,19f,23f,24f,25f,26f,35f,34f,33f,47f};  PASS
        
    //static float[] nums = new float[]{5f,6f,7f,6f,5f,9f,10f,11f,44f,45f,46f,47f,46f,45f,44f,43f,25f,24f,24f,23f,23f,22f};  //using ascending, descending and non-changing....PASS
        
    //static float[] nums = new float[]{5f,9f,13f,2f,3f,4f,3f,1f,2f,3f,4f,5f,6f,22f,66f,65f,65f,64f,63f,90f,89f,60f}; //using standalone numbers in between and also ascending/descending...PASS
        
    //static float[] nums = new float[]{1.5f,1.9f,  1.13f,  1.2f, 1.3f, 1.4f, 1.5f, 1.3f,  1.1f,  1.2f}; //all ok, ticker=ok
    //static float[] nums = new float[]{1.5f,1.9f,  1.13f,  1.2f, 1.1f, 1.4f, 1.5f, 1.3f,  1.1f,  1.2f}; //all ok, ticker=ok
        
    //ok, ticker= ok
    //static float[] nums = new float[]{2.0f,4.0f,2.0f,1.2f,1.3f,1.4f,1.3f,1.1f,1.2f,1.3f,1.4f,1.5f,1.6f,1.22f,1.66f,1.65f,1.65f,1.64f,1.63f,1.90f,1.89f,1.60f}; 
        
    //repeat numbers
    //static float[] nums = new float[]{2,2,2,4,4,1,1,9,9};  PASS
        
       
    static float[] nums = 
    {
        //4.9f, 4.8f, 4.7f, 4.6f, 4.7f, 4.8f, 4.9f, 5.0f, 48.5f, 91.7f  //in test documentation,  used to test the transition 4.6   ok, counter=ok
        //4.9f, 4.8f, 4.7f, 4.5f, 4.6f, 4.7f, 4.9f, 5.0f, 48.5f, 91.7f  //in test documentation , used to test 4.5f standalone merging upwards into ascending  ok, ticker=ok
        //0.9f, 0.8f, 0.7f, 0.6f, 0.7f, 0.8f, 0.9f, 5.0f   //test case in documentation where I resolved end of range with standalone....  ok, counter=ok
        //86.0f,77.7f, 77.8f,   77.9f, 78.0f,    78.1f,78.0f, 77.9f, 77.8f, 77.7f, 25.3f, 72.8f, 42.5f   //this will be section of the ChatGPT data in order to ensure I can resolve issues quicker, ok, ticker=ok
        //25.3f, 72.8f,42.5f, 74.5f, 74.4f, 74.3f, 74.2f, 74.1f, 74.2f, 74.3f, 74.4f,74.5f   //this will be section of the ChatGPT data in order to ensure I can resolve issues quicker, ok, ticker=ok
        //47.3f, 47.2f, 47.3f, 47.4f,47.5f  //issues encountered at end of the chatGPT array. it did not merge last two items.  ok, ticker=ok
        
        //47.4f, 47.3f,47.4f   //realised at end of the documentation, that this is failing...  ok, ticker=ok
        //47.3f, 47.4f,47.3f   // NEED TO FIX THIS ALSO, resolved as part of the above one...  ok, ticker=ok
        //47.4f, 47.3f,47.2f,47.5f  //NEED TO FIX THIS ALSO  ok, ticker=ok
        //47.3f, 47.4f,47.5f  //late fixes in code   -  FAIL   (this is straight forward ascending)  -  FAIL************  ok, ticker=ok
        //47.3f, 47.2f,47.3f,47.4f  //late fixes in code   ok, ticker=ok
        //47.4f,47.3f,47.2f,47.4f  //late fixes in code   ok, ticker=ok
        //47.3f,47.2f,47.3f,47.4f,47.5f  //late fixes in code  ok, ticker=ok
        //47.3f,47.2f,47.3f //late fixes in code  ok, ticker=ok
        //47.2f,47.3f,47.2f //late fixes in code  ok, ticker=ok
        //47.2f,47.3f,47.2f,47.1f //late fixes in code
        
        //this is first chatGPT extract
        //30032025/SummaryRange/5/4/ChatGPTgeneratedNumbers.txt
        //4.9f, 4.8f, 4.7f, 4.6f, 4.7f, 4.8f, 4.9f, 5.0f, 48.5f, 91.7f, 82.9f, 57.6f, 57.5f, 57.4f, 57.3f, 57.2f, 57.3f, 57.4f, 57.5f, 57.6f, 26.1f, 25.4f, 21.2f, 83.5f, 56.3f, 56.2f, 56.1f, 56.0f, 55.9f, 55.8f, 55.7f, 55.6f, 13.9f, 35.7f, 54.8f, 54.7f, 54.6f, 54.5f, 54.6f, 54.7f, 54.8f, 54.9f, 49.9f,  9.6f, 86.0f, 77.7f, 77.8f, 77.9f, 78.0f, 78.1f, 78.0f, 77.9f, 77.8f, 77.7f, 25.3f, 72.8f, 42.5f, 74.5f, 74.4f, 74.3f, 74.2f, 74.1f, 74.2f, 74.3f, 74.4f, 74.5f, 90.6f, 30.0f, 66.5f, 11.2f, 64.2f, 64.3f, 64.4f, 64.5f, 64.6f, 64.5f, 64.4f, 64.3f, 64.2f, 18.8f, 49.3f, 60.3f, 51.1f, 52.5f, 52.4f, 52.3f, 52.2f, 52.1f, 52.0f, 51.9f, 51.8f,  1.8f, 70.5f, 69.2f, 79.8f, 86.7f, 86.6f, 86.5f, 86.4f, 86.3f, 86.4f, 86.5f, 86.6f, 86.7f, 17.9f, 80.8f, 23.9f, 89.6f, 36.0f, 35.9f, 35.8f, 35.7f, 35.6f, 35.7f, 35.8f, 35.9f, 36.0f, 95.8f, 28.9f, 71.6f,  5.3f, 60.0f, 60.1f, 60.2f, 60.3f, 60.4f, 60.3f, 60.2f, 60.1f, 60.0f, 45.2f, 16.2f, 50.6f, 34.1f, 68.4f, 68.3f, 68.2f, 68.1f, 68.0f, 67.9f, 67.8f, 67.7f, 67.6f, 89.9f, 27.1f, 14.4f, 98.9f, 63.8f, 63.9f, 64.0f, 64.1f, 64.2f, 64.1f, 64.0f, 63.9f, 63.8f, 54.8f, 22.6f, 41.1f, 91.4f, 47.9f, 47.8f, 47.7f, 47.6f, 47.5f, 47.6f, 47.7f, 47.8f, 47.9f, 58.5f, 70.8f, 11.3f, 58.6f, 58.7f, 58.8f, 58.9f, 59.0f, 58.9f, 58.8f, 58.7f, 58.6f, 35.3f, 76.8f, 44.2f, 96.7f, 52.0f, 51.9f, 51.8f, 51.7f, 51.6f, 51.5f, 51.4f, 51.3f, 51.2f, 20.3f, 93.8f, 37.8f, 61.8f, 30.6f, 30.7f, 30.8f, 30.9f, 31.0f, 30.9f, 30.8f, 30.7f, 30.6f, 12.1f, 84.4f,  2.9f, 63.2f, 69.7f, 69.6f, 69.5f, 69.4f, 69.3f, 69.4f, 69.5f, 69.6f, 69.7f, 55.4f, 81.6f, 32.4f,  6.0f, 79.8f, 79.9f, 80.0f, 80.1f, 80.2f, 80.1f, 80.0f, 79.9f, 79.8f, 88.2f, 21.3f, 45.1f, 90.3f, 42.3f, 42.2f, 42.1f, 42.0f, 41.9f, 41.8f, 41.7f, 41.6f, 41.5f, 62.9f, 97.6f, 53.1f, 24.7f, 66.0f, 65.9f, 65.8f, 65.7f, 65.6f, 65.7f, 65.8f, 65.9f, 66.0f, 49.6f, 83.5f, 38.6f, 10.4f, 77.6f, 77.5f, 77.4f, 77.3f, 77.2f, 77.3f, 77.4f, 77.5f, 77.6f,  3.1f, 60.6f, 88.0f, 92.6f, 74.6f, 74.7f, 74.8f, 74.9f, 75.0f, 74.9f, 74.8f, 74.7f, 74.6f, 31.4f, 13.4f, 55.7f, 64.5f, 50.2f, 50.1f, 50.0f, 49.9f, 49.8f, 49.9f, 50.0f, 50.1f, 50.2f, 58.0f, 67.8f, 41.3f, 96.8f, 72.3f, 72.2f, 72.1f, 72.0f, 71.9f, 71.8f, 71.7f, 71.6f, 71.5f, 29.7f, 81.9f, 18.0f, 46.4f, 34.3f, 34.4f, 34.5f, 34.6f, 34.7f, 34.6f, 34.5f, 34.4f, 34.3f, 85.7f, 14.3f, 26.5f, 56.9f, 61.6f, 61.5f, 61.4f, 61.3f, 61.2f, 61.1f, 61.0f, 60.9f, 60.8f, 43.6f, 89.0f,  7.1f, 75.2f, 39.2f, 39.1f, 39.0f, 38.9f, 38.8f, 38.9f, 39.0f, 39.1f, 39.2f, 94.9f, 23.7f, 48.2f, 87.2f, 52.8f, 52.9f, 53.0f, 53.1f, 53.2f, 53.1f, 53.0f, 52.9f, 52.8f, 12.8f, 97.0f, 20.7f, 68.9f, 73.1f, 73.0f, 72.9f, 72.8f, 72.7f, 72.6f, 72.5f, 72.4f, 72.3f, 54.6f, 15.5f, 40.1f, 30.8f, 63.5f, 63.4f, 63.3f, 63.2f, 63.1f, 63.0f, 62.9f, 62.8f, 62.7f, 49.2f,  5.9f, 91.5f, 84.7f, 51.0f, 50.9f, 50.8f, 50.7f, 50.6f, 50.7f, 50.8f, 50.9f, 51.0f, 78.7f, 36.4f, 59.9f, 95.3f, 44.9f, 44.8f, 44.7f, 44.6f, 44.5f, 44.4f, 44.3f, 44.2f, 44.1f, 83.6f, 25.9f, 32.1f, 11.1f, 67.5f, 67.4f, 67.3f, 67.2f, 67.1f, 67.2f, 67.3f, 67.4f, 67.5f, 52.7f, 98.0f, 19.5f, 60.7f, 28.1f, 28.0f, 27.9f, 27.8f, 27.7f, 27.8f, 27.9f, 28.0f, 28.1f, 70.7f, 54.5f, 13.5f, 77.1f, 41.2f, 41.1f, 41.0f, 40.9f, 40.8f, 40.7f, 40.6f, 40.5f, 40.4f, 59.4f, 90.0f,  6.7f, 85.4f, 69.5f, 69.6f, 69.7f, 69.8f, 69.9f, 70.0f, 70.1f, 70.2f, 70.3f, 38.0f, 12.4f, 95.2f, 57.1f, 50.4f, 50.3f, 50.2f, 50.1f, 50.0f, 49.9f, 49.8f, 49.7f, 49.6f, 61.7f, 27.6f, 43.1f, 83.8f, 73.4f, 73.5f, 73.6f, 73.7f, 73.8f, 73.7f, 73.6f, 73.5f, 73.4f, 16.3f, 97.2f, 21.5f, 66.2f, 47.1f, 47.2f, 47.3f, 47.4f, 47.5f, 47.4f, 47.3f, 47.2f, 47.1f, 33.5f, 76.3f, 42.9f,  4.3f, 62.4f, 62.3f, 62.2f, 62.1f, 62.0f, 61.9f, 61.8f, 61.7f, 61.6f, 82.4f, 24.4f, 58.4f,  9.7f, 90.4f, 90.3f, 90.2f, 90.1f, 90.0f, 89.9f, 89.8f, 89.7f, 89.6f, 34.9f, 14.7f, 30.2f, 96.2f, 52.4f, 52.3f, 52.2f, 52.1f, 52.0f, 51.9f, 51.8f, 51.7f, 51.6f, 71.8f, 59.2f, 10.6f, 84.2f, 63.7f, 63.8f, 63.9f, 64.0f, 64.1f, 64.0f, 63.9f, 63.8f, 63.7f, 46.6f, 18.2f, 45.4f, 82.0f, 78.6f, 78.5f, 78.4f, 78.3f, 78.2f, 78.3f, 78.4f, 78.5f, 78.6f, 95.4f, 32.6f, 23.3f, 68.8f, 41.8f, 41.7f, 41.6f, 41.5f, 41.4f, 41.3f, 41.2f, 41.1f, 41.0f, 58.9f, 27.4f, 56.1f, 88.7f, 50.8f, 50.9f, 51.0f, 51.1f, 51.2f, 51.1f, 51.0f, 50.9f, 50.8f, 12.9f, 72.1f, 33.3f, 67.9f, 74.9f, 74.8f, 74.7f, 74.6f, 74.5f, 74.6f, 74.7f, 74.8f, 74.9f, 49.0f, 21.9f, 61.2f, 93.6f, 55.3f, 55.2f, 55.1f, 55.0f, 55.1f, 55.2f, 55.3f, 55.4f, 55.5f, 43.4f, 61.0f, 47.3f, 47.4f
        
        //small extract taken from second chatGPT extract    
        //40.1f, 40.1f, 35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f, 85.5f, 85.4f, 85.3f, 85.2f,19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f    
   
        //this is second chatGPT extract   30032025/SummaryRange/5/4/ChatGPTgeneratedNumbersBetterDataSet.txt     
        //75.0f, 75.0f, 95.6f, 95.7f, 95.8f, 95.9f, 96.0f, 96.1f, 40.1f, 40.1f    //************************FAIL  //ok, ticker=ok
        
        //this is second chatGPT extract
        //30032025/SummaryRange/5/4/ChatGPTgeneratedNumbersBetterDataSet.txt    ok, ticker=ok
         //75.0f, 75.0f, 95.6f, 95.7f, 95.8f, 95.9f, 96.0f, 96.1f, 40.1f, 40.1f,35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f, 85.5f, 85.4f, 85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f, 48.6f, 48.5f, 48.4f, 48.3f, 48.2f, 48.3f, 48.4f, 48.5f, 48.6f, 65.2f, 82.1f, 82.2f, 82.3f, 82.4f, 82.5f, 82.4f, 82.3f, 82.2f, 82.1f, 28.9f, 28.8f, 28.7f, 28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 28.1f, 28.0f, 39.0f, 33.6f, 33.7f, 33.8f, 33.9f, 34.0f, 34.1f, 34.2f, 34.3f, 75.9f, 75.9f, 54.3f, 54.2f, 54.1f, 54.0f, 53.9f, 54.0f, 54.1f, 54.2f, 54.3f, 11.5f, 91.4f, 91.5f, 91.6f, 91.7f, 91.8f, 91.7f, 91.6f, 91.5f, 91.4f, 66.8f, 66.9f, 67.0f, 67.1f, 67.2f, 67.3f,  7.7f,  7.7f, 49.6f, 49.6f, 49.6f, 57.7f, 57.8f, 57.9f, 58.0f, 58.1f, 58.0f, 57.9f, 57.8f, 57.7f, 24.2f, 70.5f, 70.4f, 70.3f, 70.2f, 70.1f, 70.0f, 69.9f, 69.8f, 69.7f, 92.2f, 31.3f, 31.4f, 31.5f, 31.6f, 31.7f, 31.8f, 31.7f, 31.6f, 31.5f, 31.4f, 13.3f, 13.3f, 86.4f, 86.3f, 86.2f, 86.1f, 86.0f, 85.9f, 85.8f, 85.7f, 45.0f, 45.1f, 45.2f, 45.3f, 45.4f, 45.5f, 45.4f, 45.3f, 45.2f, 45.1f, 22.2f, 22.2f, 22.2f, 99.0f, 98.9f, 98.8f, 98.7f, 98.6f, 98.5f, 98.6f, 98.7f, 98.8f, 98.9f, 99.0f, 12.8f, 12.9f, 13.0f, 13.1f, 13.2f, 13.3f, 13.4f, 13.5f, 13.6f, 13.7f, 55.4f, 55.5f, 55.6f, 55.7f, 55.8f, 55.9f, 55.8f, 55.7f, 55.6f, 55.5f, 40.2f, 40.2f, 40.2f, 83.0f, 82.9f, 82.8f, 82.7f, 82.6f, 82.5f, 82.4f, 82.5f, 82.6f, 82.7f, 82.8f,30.8f, 30.9f, 31.0f, 31.1f, 31.2f, 31.1f, 31.0f, 30.9f, 30.8f, 18.5f,62.9f, 63.0f, 63.1f, 63.2f, 63.3f, 63.4f, 63.3f, 63.2f, 63.1f, 63.0f,41.2f, 41.1f, 41.0f, 40.9f, 40.8f, 40.7f, 40.6f, 40.5f, 40.4f, 40.3f,18.7f, 18.8f, 18.9f, 18.8f, 18.7f, 60.7f, 60.6f, 60.5f, 60.4f, 60.3f,60.4f, 60.5f, 60.6f, 60.7f, 71.3f, 71.4f, 71.5f, 71.6f, 71.7f, 71.6f,71.5f, 71.4f, 71.3f, 55.1f
         //60.5f, 60.4f, 60.3f,60.4f, 60.5f, 60.6f, 60.7f, 71.3f, 71.4f, 71.5f, 71.6f, 71.7f, 71.6f,71.5f, 71.4f, 71.3f
         
         
         //No issues with Descending following a previous D-A sequence
          //60.5f, 60.4f, 60.3f,60.4f, 60.5f, 60.6f, 60.7f, 72.1f, 72.0f, 1.9f, 71.8f, 71.7f, 71.8f,71.9f, 80.0f, 80.1f
         
          //can see issues with  A which is preceded with A-D sequence
          60.1f, 60.2f, 60.3f,60.2f, 60.1f, 60.0f, 59.9f, 71.3f, 71.4f, 71.5f, 71.6f, 71.7f,55.0f,55.1f,55.2f
          
          //issues if sequence is AD(A-D)
          //60.1f, 60.2f, 60.3f,60.5f, 60.4f, 60.3f, 60.2f, 71.3f, 71.4f, 71.5f, 71.6f, 71.7f, 71.6f,71.5f, 71.4f, 71.3f
          
          //60.1f,60.2f,60.1f,34.3f,34.4f,34.5f,44.0f
          
          //No issues with ascending following a previous D-A sequence
          //60.5f, 60.4f, 60.3f,60.4f, 60.5f, 60.6f, 60.7f, 72.1f, 72.2f, 72.3f
          
          
          //issues A-D-A-D
          //60.1f, 60.2f, 60.3f,60.2f, 60.1f,60.2f, 60.3f,60.2f, 60.1f
         
         
        
        //85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f
        
        
        //75.0f, 75.0f, 95.6f, 95.7f, 95.8f, 95.9f, 96.0f, 96.1f, 40.1f, 40.1f,35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f, 85.5f, 85.4f, 85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f, 48.6f, 48.5f, 48.4f, 48.3f, 48.2f, 48.3f, 48.4f, 48.5f, 48.6f, 65.2f, 82.1f, 82.2f, 82.3f, 82.4f, 82.5f, 82.4f, 82.3f, 82.2f, 82.1f, 28.9f, 28.8f, 28.7f, 28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 28.1f, 28.0f, 39.0f, 33.6f, 33.7f, 33.8f, 33.9f, 34.0f, 34.1f, 34.2f, 34.3f, 75.9f
       
        //***THESE ARE EXTRACTS FROM CHATGPT second extract.... *****
        //Trying to understand why failing after changes in code.. It now passes
        //75.9f, 75.9f, 54.3f, 54.2f, 54.1f, 54.0f, 53.9f, 54.0f, 54.1f, 54.2f, 54.3f, 11.5f  //(RESOLVED)  ok, ticker=ok
        //I am not sure where (53.9->54.0) has arisen from..
        //I will quickly investigate
        //[33.9->34.3, 75.9, 54.3->53.9, (53.9->54.0), 53.9->54.3, 11.5, 91.4->91.8]
       
        //34.1f,34.2f,34.3f,75.9f,75.9f,54.3f,54.2f,54.1f,54.0f,53.9f,54.0f,54.1f,54.2f,54.3f   //ok, ticker=ok
       
        //focussing on 2-3 runs of ascending/descending and overlapping transition
        //*****************************************************
         
        //****PASS CASES*************************************************************************
         
         //3.5f,3.4f,3.0f,2.9f,2.5f,2.4f   //descending descending descending  ok, ticker=ok
         //3.5f,3.4f,3.0f,2.9f,4.5f,4.6f   //descending descending ascending  ok, ticker=ok
        
         //3.0f,2.7f,2.5f,2.4f,2.5f,2.6f  //changed last digit, want to see how it handles this  ****FAIL************** ok, ticker=ok
         //3.5f,3.4f,3.5f,3.6f,32.1f,32.2f   //descending ascending ascending  ok, ticker=ok
       
        //5.0f,4.9f,4.8f  //most basic desecnding  ok, ticker=ok
        //47.3f, 47.4f,47.5f  //(RESOLVED)  ok, ticker=ok
        //47.3f, 47.4f  ok, ticker=ok
        //3.0f,2.7f,2.5f,2.4f,2.5f,2.6f  //(RESOLVED)  ok, ticker=ok
        //3.0f,2.7f,2.5f,2.4f,2.5f,4.0f  //exploring above scenario but the descend is slightly longer  ***FAIL**********  (RESOLVED) ok, ticker=ok
         
        //2.5f,2.4f,2.5f  //ok, ticker=ok
        
         //3.5f,3.6f, 3.5f, 3.6f, 3.5f,3.4f,3.0f,2.9f,2.5f,2.4f  //ascending descending ascending  descending descending descending ok, ticker=ok
         //4.6f,3.5f,3.4f,3.5f,3.4f,6.7f,6.9f   //descending ascending descending        (NOW FAILS)----------------------------- ok, ticker=ok
         
         //3.5f,3.6f,40.0f,40.1f   //it has not written  3.5f,3.6f,40.0f  ok, ticker=ok
        
        //new test cases exploring standalone repeat numbers
         
        //40.2f,40.2f,96.0f, 96.1f   //(standalone at front) ok, ticker=ok
        // 40.2f,40.2f,96.0f, 96.0f,33.4f   //(two standalones at front, repeat)  ok, ticker=ok
        //40.1f, 45.1f  //(it merges them, very basic error in my logic to resolve)  ok, ticker=ok
        
        //3.5f,3.6f,40.0f,40.1f   //(simple ascending, ascending) ok, ticker=ok
        //3.5f,3.6f,40.0f,40.1f,56.2f   //(simple ascending, ascending, then standalone) ok, ticker=ok
        //3.5f,3.6f,40.0f,40.1f,56.2f,56.3f  //ascending ascending ascending   (writing 3.5->40.1, 56.2->56.3) ok, ticker=ok
        //3.5f,3.6f,40.1f,4.1f,40.0f   //ascending standalone  (it has only written standalone cases) ok, ticker=ok
       
        //ok, ticker=ok
        //75.0f, 75.0f, 95.6f, 95.7f, 95.8f, 95.9f, 96.0f, 96.1f, 40.1f, 40.1f,35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f, 85.5f, 85.4f, 85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f, 48.6f, 48.5f, 48.4f, 48.3f, 48.2f, 48.3f, 48.4f, 48.5f, 48.6f, 65.2f, 82.1f, 82.2f, 82.3f, 82.4f, 82.5f, 82.4f, 82.3f, 82.2f, 82.1f, 28.9f, 28.8f, 28.7f, 28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 28.1f, 28.0f, 39.0f, 33.6f, 33.7f, 33.8f, 33.9f, 34.0f, 34.1f, 34.2f, 34.3f, 75.9f, 75.9f, 54.3f, 54.2f, 54.1f, 54.0f, 53.9f, 54.0f, 54.1f, 54.2f, 54.3f, 11.5f, 
       
        //this now fails, so it appears that it needs to perform 0000Write when k==1-
      
        //3.5f,3.6f,3.5f,40.0f  // (simple ascending, then standalone)  ok, ticker=ok
        //3.6f,3.5f,3.6f,40.0f  // (simple ascending, then standalone)  ok, ticker=ok
        
        //3.0f,2.5f,2.4f,2.5f,2.8f,2.9f  //(This is fine, but the next example, it writes 2.4->2.5 twice). ok, ticker=ok
        //3.0f,2.7f,2.5f,2.4f,2.5f,4.0f  //exploring above scenario but the descend is slightly longer  ***FAIL**********  (RESOLVED) ok, ticker=ok
        //40.2f,40.2f,96.0f, 96.1f,3.0f,3.0f   //(standalone at end both not writteny)  ok, ticker=ok
        //47.3f,40.0f,40.1f,3.5f   //failing adding range twice  ok, ticker=ok
        //96.0f, 96.1f, 40.1f, 40.1f  //(does not write standalones at end) ok, ticker=ok
        //56.0f,96.0f, 96.1f,96.2f,96.3f, 40.1f, 40.1f,40.2f,40.2f  //(does not write standalones at end due to skipping iteration) ok, ticker=ok
        
        //LATE TEST CASES**************************************************************************
        //***ISSUE WHEN 2 DESCENDING AT END*** (RESOLVED)
        //3.5f,3.6f,3.7f,3.8f,3.7f     //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f,3.7f,3.9f,4.0f  //ok, ticker=ok
        //***ISSUE WHEN 4 DESCENDING AT END***
        //3.5f,3.6f,3.7f,3.8f,3.7f,45.5f,45.4f  //ok, ticker=ok
        //*****NO ISSUE 2 ASCENDING AT END
        //3.5f,3.4f,3.35f,3.6f,3.7f,3.8f  //ok, ticker=ok
        //3.7f,3.8f,3.7f,3.9f,4.0f,3.5f,3.6f,3.7f,3.8f,3.7f,45.5f,45.4f,3f,3.2f,3.3f  ok, ticker=ok
        
        //used to test the ticker
        //3.5f,3.4f,3.35f,3.6f,3.7f,3.8f,3.7f,3.5f,3.6f,3.7f,3.8f,3.7f  //ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f, 3.7f,3.5f,3.6f,3.7f,3.8f,3.7f,3.6f,3.5f  //ok, ticker=ok
           
         
        //ISSUES THESE //Related to oversized or undersized ticker, it relates to transition and also standalone value occuring prior to it
        //35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f  //ticker incorrect**********************  //ok, ticker=ok  A D S 
        //3.5f,3.6f,3.7f,3.8f, 3.7f,  3.5f,  3.6f,3.7f,3.8f,  3.7f,3.6f,  3.5f,3.6f,3.7f,3.8f  //ok, ticker=ok   A D A D A
        //5.0f, 48.5f,28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 3.5f,3.6f, 3.5f   //ok, ticker=ok  //issues     D (A - too large) D
        //28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 3.5f,3.6f, 3.5f  //rule does not work DAD  //issues
        //It appears that ascendingcounter SHOULD NOT BE INCREASED IN THE NEW RULE IN THE COMPLETETICKER METHOD WHERE 
        //ascendingcounter==1 and descending in both directions....
         
        //29.9f,30.0f,28.9f,28.8f,28.9f,29.0f  //no issues ADA      //ok, ticker=ok
         
          
        //1.1f,1.2f,1.3f,1.2f,1.1f  //ok, ticker=ok
        //1.5f,1.4f,1.3f,1.4f,1.5f   //ok, ticker=ok
          
        //2.9f,2.8f,2.7f,2.6f,2.5f,2.4f,2.3f,2.4f,2.5f,2.6f,2.7f,2.8f,2.7f,4.0f  //ok, ticker=ok
        //3.0f,3.1f,3.2f,3.3f,3.2f,3.1f,3.2f,4.0f  //ok, ticker=ok
          
        
        //*****NO ISSUE 3 DESCENDING AT END
        //3.5f,3.6f,3.7f,3.8f,3.7f,3.6f  //ok, ticker=ok
        //Now combining lots of these together...
         
        //3.5f,3.6f,3.7f,3.5f,3.4f,3.3f,3.2f,25.0f,25.1f,49,3f,3.33f,3.7f,3.6f  //ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f,3.7f,45.5f,45.4f  //ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f,3.7f,3.8f     //ok, ticker=ok
        
        //3.5f,3.6f,3.5f   //it is worth focussing on most simplest example to understand   //ok, ticker=ok
        
        //3.5f,3.6f, 3.5f, 3.6f, 3.5f,3.4f,3.0f,2.9f,2.5f,2.4f  //ascending descending ascending  descending descending descending   //ok, ticker=ok
        //so need to configure variable 
        
        //3.5f,3.6f,3.5f,3.1f,3.0f,2.9f   //ascending descending descending   //ok, ticker=ok
        //3.5f,3.6f,3.5f,3.6f   //ascending descending ascending   //ok, ticker=ok
        //3.5f,3.6f,3.5f,3.2f,3.1f   //ascending descending descending  //ok, ticker=ok
       
        //Extreme late test case scenario
        //0.1f,0.2f,0.1f   //ok, ticker=ok
       
        //85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f   //ok, ticker=ok
        //56.0f,96.0f, 96.1f,96.2f,96.3f, 40.1f, 40.1f,40.2f,40.2f  //(does not write standalones at end due to skipping iteration)   //ok, ticker=ok
        //56.0f,96.0f, 96.1f,96.2f,96.3f, 40.1f, 40.3f,40.2f,40.2f,40.1f,40.3f,40.5f  //(does not write standalones at end due to skipping iteration)  //ok, ticker=ok
        //28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 28.1f, 28.0f, 39.0f, 33.6f, 33.7f, 33.8f  //ok, ticker=ok
       
        //late testing ticker
        //4.9f, 4.8f, 4.7f, 4.6f,4.7f, 4.8f, 4.9f, 5.0f, 48.5f,28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 3.5f,3.6f, 3.5f  //ok, ticker=ok
        //85.3f, 85.2f, 19.6f, 19.7f, 19.8f, 19.9f, 7.0f,6.9f,6.8f,6.7f, 20.0f, 19.9f, 19.8f, 63.5f, 14.9f, 14.9f    //ok, ticker=ok
        //4.9f, 4.8f, 4.7f, 4.6f,5.0f,4.5f  //ok, ticker=ok
       
        //LATE TESTING DUE TO HIGH COUNT OF DESCENDING IN TICKER
        //7.1f,6.5f,6.4f,6.3f,6.2f//no issues  //ok, ticker=ok
         
        //so need to set flag if tickerCounter>1
        //4.9f, 4.8f, 4.7f, 10.0f,5.0f,4.9f,4.8f,4.7f,5.0f,4.9f,4.8f   //(no issues if 3 descending chains) //ok, ticker=ok
        
        //7.1f,7.2f,6.5f,6.4f,6.3f,6.2f, 8.0f //issues with standalone at end
         
        //EXAMPLE OF ISSUE WITH TICKER
        //3.5f,3.6f, 3.5f, 3.6f, 3.5f,3.4f,3.0f,2.9f,2.4f,2.5f  //ok, ticker=ok
        //40.1f,35.1f, 35.2f, 35.3f, 35.2f, 35.1f, 85.6f    //ISSUES  //ok, ticker=ok
        //3.5f,3.4f,3.35f,3.6f,3.7f,3.8f,3.7f,3.5f,3.6f,3.7f,3.8f,3.7f  //fixed  //ok, ticker=ok
          
        //4.1f,4.0f,3.9f,3.8f,3.9f,40.f   //issue with counter for descending  //ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f,3.7f,3.6f                //ok, ticker=ok
          
        //3.5f,3.6f,3.5f,3.1f,3.0f,2.9f   //ascending descending descending     //ISSUES  //ok, ticker=ok
         
        //4.9f, 4.8f, 4.7f, 4.6f,4.7f, 4.8f, 4.9f, 5.0f, 48.5f,28.6f, 28.5f, 28.4f, 28.3f, 28.2f, 3.5f,3.6f, 3.5f  //ok, ticker=ok
        //0.1f,0.2f,0.1f           //ascending descending  //ok, ticker=ok
        //3.5f,3.6f,3.5f,3.2f,3.1f   //ascending descending descending        //ok, ticker=ok
          
        //3.3f,3.2f,3.3f,3.2f,3.3f,3.3f,3.3f,3.4f  //ok, ticker=ok
        //4.1f,4.0f,3.9f,3.8f,3.8f,3.9f   //fixed  //ok, ticker=ok    UP TO HERE------------------------------------------
          
        //issue with repeat standalone appearing
        //4.1f,4.0f,3.9f,3.8f,3.8f,3.9f   //fixed  //ok, ticker=ok
        //3.5f,3.6f,3.7f,3.8f,3.8f,3.9f   //fixed   ok, counter=ok
          
        //4.1f,4.0f,3.9f,3.8f,3.8f,3.7f,3.6f,3.9f  //ISSSUESS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1  //ok, ticker=ok
          
        //4.1f,4.0f,7.2f,7.2f,3.9f,3.8f,3.8f,4.4f,4.3f,3.7f,3.7f  //ISSSUESS with the counter-------- //ok, ticker=ok
        
        //2.0f,3.45f,2.1f,2.2f,3.67f,3.9f,3.8f,3.5f  //ok, ticker=ok
        
        //4.9f,7.2f,3.5f,3.6f,3.7f,3.8f,3.8f,3.9f   //trying standalones at the front,  //ok, ticker=ok
         
        //4.9f,7.2f,3.5f,3.6f,43.0f,49.0f,3.7f,3.8f,3.8f,3.9f   //trying standalones at end, //ok, ticker=ok
         
        //4.9f,7.2f,3.5f,3.6f,43.0f, 49.0f,48.9f,48.7f,48.7f,48.6f,40.0f,3.7f,3.8f,3.8f,3.9f   //trying standalones in between.. //ok, ticker=ok
        //25.3f, 72.8f,42.5f, 74.5f, 74.4f, 74.3f, 74.2f, 74.1f, 74.2f, 74.3f, 74.4f,74.5f //issue with ticker at end, value too small, fixed //ok, ticker=ok
         
        //USED FOR LATE TESTING OF CODE - ALL LATE PROBLEMS OF STANDALONE IN BETWEEN WHICH ARE PART OF THE RANGE
        //4.9f,5.0f,5.1f,5.1f,5.2f,4.0f //standalone is not at k==nums.length-2,  //ok, ticker=ok
           
        //issue now is that having 4.9f,4.8f,4.8f,5.0f,5.1f,5.1f,5.2f,4.0f 
        //it does not wrrite any standalone for repeating 5.1f.
        //this is correct.. But we have nothing to differentiate it from a transition
        //so i would need more screen comments
        //i lack outputs in the section around standalone numbers
         
        //THESE ARE ALL PART OF LAST MY APPROACH DOCUMENT (NOT CONFIDENT ABOUT TICKER ON ALL OF THESE)
        //4.9f,4.8f,4.8f,5.0f,5.1f,5.1f,5.2f,4.0f  // -------------------------------------------- //ok, ticker=ok
        //4.9f,4.8f,4.8f,5.0f,4.9f,4.9f,5.1f,5.1f,5.2f,4.0f     //ok, ticker=ok
        //4.8f,4.9f,4.9f,4.7f,5.9f,5.9f,6.1f,6.1f,6.2f,4.0f  //ok, ticker=ok
        //4.7f,4.8f,4.9f,5.0f,5.0f,4.9f,4.8f,4.7f    //ok, ticker=ok
                
        //5.3f,5.2f,5.1f,5.0f,5.0f,5.1f,4.8f,4.7f    //ok, ticker=ok
        //5.3f,5.2f,5.1f,5.0f,5.0f,5.0f,5.1f,4.8f,4.7f    //ok, ticker=ok
                
        //4.7f,4.8f,4.9f,5.0f,5.0f,5.0f,4.9f,4.8f,4.7f  //ok, ticker=ok
                  
        //4.7f,4.8f,4.9f,5.0f,5.0f,4.9f  //ok, ticker=ok
        //4.7f,4.8f,4.9f,5.0f,4.8f,4.9f,5.0f,5.0f,4.9f  //ok, ticker=ok
                    
        //4.7f,4.8f,4.9f,5.0f,5.0f,5.0f,4.9f  //ok, ticker=ok
        //5.3f,5.2f,5.1f,5.0f,5.1f,5.2f,5.3f   //ok, ticker=ok
        //5.3f,5.2f,5.1f,5.0f,5.0f,5.0f,5.1f,5.2f,5.3f   //ok, counter issue at end,   //ok, ticker=ok
        //5.3f,5.2f,5.1f,5.0f,5.0f,5.1f   //ok, //ok, ticker=ok
        //4.7f,4.8f,4.9f,5.0f,5.0f,5.0f,4.9f //ok, ticker=ok
        //4.7f,4.8f,4.9f,5.1f,5.1f,4.9f,4.8f,4.7f  //ok, ticker=ok
        //5.3f,5.2f,5.1f,5.4f,5.4f,5.2f,5.1f  //ok, ticker=ok
        //5.3f,5.2f,5.7f,5.7f,5.1f,5.1f  //ok, ticker=ok
        //4.7f,4.8f,4.9f,5.1f,5.1f,5.3f,5.2f,5.7f,5.7f,5.1f,5.1f,4.9f,4.8f,4.7f   //ok, ticker=ok
            
        //3.4f,3.5f,3.6f,3.6f,3.5f,3.4f,3.3f,3.2f, 3.3f,3.3f,3.3f,3.4f,3.6f,55.0f  //ok, ticker=ok
         
        //3.3f,3.3f,3.4f,3.3f,3.2f  //issues------------------------------------------------//ok, ticker=ok
           
        //3.3f,3.3f,3.2f,3.3f,3.4f  //ok, ticker=ok
        //3.3f,3.3f,3.3f,3.3f,3.3f,3.2f,3.3f,3.4f  //ok, ticker=ok
        //3.3f,3.3f,3.3f,3.2f,3.2f,3.2f,3.1f,3.1f //ok, ticker=ok
           
        //3.3f,3.3f,3.3f,3.6f,3.6f  //ok, ticker=ok
           
        //3.4f,3.4f,3.4f,3.3f,3.4f,3.2f //ok, ticker=ok
        //3.3f,3.3f,3.3f,3.6f,3.6f,3.5f,3.5f,3.4f,3.3f  //ok, ticker=ok
         
         //mixing several test cases
         //3.4f,3.4f,3.3f,3.3f,3.3f,3.4f,4.7f,4.8f,4.9f,5.0f,5.0f,5.0f,4.9f,3.3f,3.2f,3.4f,3.3f,3.4f,3.2f  ///ok, ticker=ok
         //4.7f,4.8f,4.9f,5.0f,5.0f,5.0f,4.9f,3.3f,3.2f,3.4f,3.3f,3.4f,3.2f  //ok, counter=ok
    };
    
    
    public static void main (String[] args)
    {
        int lengthNums = nums.length;
    
        System.out.println(summaryRanges(nums,lengthNums));
        System.out.println("Standalone numbers: " + standaloneCount + "   Ascending chains: " + ascendingChainsComplete + "   Descending chains: " + descendingChainsComplete + "      TOTAL: " + tickerCounter);
        System.out.println("Transition events: " + transitionEvents);
    }
    
    public static String completeTicker(String start, String end, int k, int lengthNums)
    {
        System.out.println("ac: " + ascendingCounter);
        System.out.println(descendingCounter);
        
        if (!start.equals("END") && !end.equals("END"))
        {
            tickerCounter++;
            
            if (start.equals(end))
            {
                currentOutcome="standalone";
                ticker=ticker+"S";
                standaloneCount++;
                isStandalone=true;
                
                 if (tickerCounter%3!=0)
                {
                    
                    
                if (previousOutcome=="")
                {
                previousOutcome="standalone";
                hasStore=true;
                }
                
                if(previousOutcome!="" && !hasStore)
                {
                    previousPreviousOutcome=previousOutcome;
                    replicateNumber=true;
                }
                
                if (previousOutcome!="" && previousPreviousOutcome!="" && replicateNumber)
                {
                    previousOutcome="standalone";
                }
                }
            }
            
            if(!isStandalone)
            {   
                if (Float.valueOf(end)>Float.valueOf(start))
                {
                    currentOutcome="ascending";
                    
                if (tickerCounter%3!=0)
                {
                    
                    if (previousOutcome=="")
                {
                previousOutcome="ascending";
                System.out.println("IN HERE");
                hasStore=true;
                }
                
                if(previousOutcome!="" && !hasStore)
                {
                    previousPreviousOutcome=previousOutcome;
                    replicateNumber=true;
                }
                
                if (previousOutcome!="" && previousPreviousOutcome!="" && replicateNumber)
                {
                    previousOutcome="ascending";
                }
                }
                
                
                currentOutcome="ascending";
                System.out.println("VAL: " + previousOutcome);
                    
                    if (ascendingCounter==0 || ascendingCounter==1)
                    {
                        ascendingCounter=2;
                        hasAdjust=true;
                    }   
                    
                    if ((tickerCounter==1 || tickerCounter==2)
                    && (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon) 
                    && (!hasAdjust))
                    {
                           ascendingCounter=ascendingCounter+1;
                           hasAdjust=true;
                    }   
                                                        
                    if ((previousOutcome=="standalone")
                    && (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon) 
                    && (!hasAdjust))
                    {
                        ascendingCounter=ascendingCounter+1;
                        hasAdjust=true;
                    }
                    
                    if ((k==lengthNums-2) && !hasAdjust)
                    {
                        ascendingCounter=ascendingCounter+1;
                    }
                    
                    
                    if ((currentOutcome=="ascending") 
                    &&(hasTransitionOccurred) 
                    &&(previousPreviousOutcome=="ascending") 
                    &&(previousOutcome=="descending")
                    &&!(hasAdjust)
                    && (k!=nums.length-2))
                    {
                        System.out.println(ascendingCounter);
                        System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
                        System.out.println("RE-ADJUSTED A sequence due to precede A-D");
                         System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
                        ascendingCounter++;
                        hasReadjustChain=true;
                    }
                    
                    if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                    {
                        ticker=ticker+"A"+"("+(ascendingCounter)+")-";
                        transitionEvents++;
                        hasTransitionOccurred=true;
                    }
                    else
                    {
                        ticker=ticker+"A"+"("+(ascendingCounter)+")";
                    }
                    
                    ascendingChainsComplete++;
                    ascendingCounter=0;
                    //previousOutcome="";
                }
                else
                {
                    System.out.println("NOT BE HERE");
                    currentOutcome="descending";
                 
                  if (tickerCounter%3!=0)
                {
                    
                    if (previousOutcome=="")
                {
                previousOutcome="descending";   //late change
                hasStore=true;
                }
                
                if(previousOutcome!="" && !hasStore)
                {
                    previousPreviousOutcome=previousOutcome;
                    replicateNumber=true;
                }
                
                if (previousOutcome!="" && previousPreviousOutcome!="" && replicateNumber)
                {
                    previousOutcome="descending";
                }
                }
                    if (descendingCounter==0 || descendingCounter==1)
                    {
                        hasAdjust=true;
                        descendingCounter=2;
                    }
                    
                    if ((k==lengthNums-2) 
                    && (!hasAdjust)  
                    && (Math.abs(nums[k] - (nums[k+1] - difference)) >epsilon) 
                    && !(Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon))
                    {
                        descendingCounter=descendingCounter+1;
                        hasAdjust=true;
                    }
                    
                    if (!(Math.abs(Float.valueOf(start) - (Float.valueOf(end) + difference)) <epsilon)
                    && !(Math.abs(Float.valueOf(end) - (Float.valueOf(start) + difference)) <epsilon))
                    {
                        if (!(k==lengthNums-2) && descendingCounter>=2 && !hasAdjust)
                        {
                            descendingCounter=descendingCounter+1;
                            hasAdjust=true;
                        }
                        
                        if ((k==lengthNums-2) && descendingCounter>=2 && !hasAdjust)
                        {
                            if (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                            {
                                descendingCounter=descendingCounter+1;
                                hasAdjust=true;
                            }
                        }
                    }
                    
                    if (tickerCounter==1 && !hasAdjust  && !(k==lengthNums-2))
                    {   
                        descendingCounter=descendingCounter+1;
                    }
                    
                    if (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                    {
                        ticker=ticker+"D"+"("+(descendingCounter)+")-";
                        transitionEvents++;
                        hasTransitionOccurred=true;
                    }
                    else
                    {
                        ticker=ticker+"D"+"("+(descendingCounter)+")";
                    }
                    
                    descendingChainsComplete++;
                    descendingCounter=0;
                }
            }
        }
        
        hasStandaloneAfter=true;
        isStandalone=false;
        hasAdjust=false;
        hasStore=false;
        
        if (!standaloneTemp.equals(""))
        {
            sm.add(standaloneTemp);
            ticker=ticker+"S";
            standaloneCount++;
            standaloneTemp="";
        }
        
        System.out.println("***********TICKER*********: " + ticker + "\n");
        
        System.out.println("VAL1: " + previousOutcome);
        System.out.println("CURRENT: " + currentOutcome);
        
        
        if (tickerCounter%3==0)
        {
            /*
            //now going to focus on if   (A-D) is preceded with anything.
                    //the correct execution point would at intervals of three writes
                    //since it would guarantee this is valid check
                    
                    //we know currentOutcome="descending"
                    //we know that previousOutcome="ascending"
                    //previousPreviousOutcome="irrelevant"
                    
                    System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
                    System.out.println(hasTransitionOccurred);
                    System.out.println(currentOutcome);
                    System.out.println(previousOutcome);
                    System.out.println(previousPreviousOutcome);
                    System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
                    
                    
                    if (hasTransitionOccurred && currentOutcome=="descending" && previousOutcome=="ascending" && previousPreviousOutcome!="")
                    {
                        System.out.println("REQUIRED TO RE-ADJUST TICKER FOR A-D due to prior numbers");
                        
                        System.out.println("LAST INDEX A: " + ticker.lastIndexOf("A"));
                        
                        String AToD = ticker.substring(ticker.lastIndexOf("A"),ticker.lastIndexOf(")")+1);
                        System.out.println(AToD);
                        
                    }
                    */
                    
            
            
            
            
            System.out.println("Prev: " + previousOutcome);
            System.out.println("before prev: " + previousPreviousOutcome);
            
            System.out.println("CLEARING HISTORIC VALUE");
            previousPreviousOutcome="";
            previousOutcome=currentOutcome;
            
            replicateNumber=false;
            hasTransitionOccurred=false;
        }
        
        System.out.println("prev prev: " + previousPreviousOutcome);
        System.out.println("prev:" + previousOutcome);
        
        
        
        return ticker;
    }
    
    public static List<String> summaryRanges(float[] nums, int lengthNums) 
    {
        boolean hasWrittenRepeatNumber=false;
        boolean writtenPrevious=false;   
        boolean combineMerge=false;
        boolean hasNotWrittenLastNumber=true;
        boolean isFirstOccurenceAscendingChain=false;
        boolean isFirstOccurenceAscendingChainNoTransition =false;
        boolean hasWrittenStoreDueTransition = false;
                
        int counter = 0;
        String start="";
        String end="";
        String temp="";
        String backupStart="";
        
        String transitionNumber="";
        
        if (nums.length==1)
        {
            start=String.valueOf(nums[0]);
            sm.add(start);
            System.out.println("1Writing Standalone: " + start);
            completeTicker(start, start,0,lengthNums);
            return sm;
        }

        for (int k=0; k<nums.length-1;k++)
        {
            if (k==0)
            {
                start=String.valueOf(nums[k]);
            }
            
            if (nums[k]!=nums[k+1])
            {
                System.out.println("\nCHECKING: " + nums[k] + " with " + nums[k+1]);
                //System.out.println("---------------------------VALS d: " + descendingCounter);
                //System.out.println("---------------------------VALS a: " + ascendingCounter);
                
                System.out.println("currently in list: " + sm);
                
                 if (!potentialfurtherAscendingBeyondThisStart.equals("") 
                 && !(potentialfurtherAscendingBeyondThisEnd.equals("")) 
                 && (nums[k+1]<=Float.valueOf(potentialfurtherAscendingBeyondThisStart)))
                 {
                     if (potentialfurtherAscendingBeyondThisStart.equals(nums[k]))
                     {
                         System.out.println("Stored value also ascending and overlap, not storing");
                         System.out.println("NO storage required");
                         potentialfurtherAscendingBeyondThisStart="";
                         potentialfurtherAscendingBeyondThisEnd="";
                    }
                }
                    
                if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                {
                    System.out.println("Descending sequence (difference)");
                    
                    descendingCounter++;
                    
                    if ((potentialfurtherAscendingBeyondThisStart=="")
                    && (potentialfurtherAscendingBeyondThisEnd=="") 
                    && (k!=nums.length-2))
                    {
                        start=String.valueOf(nums[k]);
                        end=String.valueOf(nums[k+1]);
                        potentialfurtherAscendingBeyondThisStart = start; 
                        potentialfurtherAscendingBeyondThisEnd = end;
                        System.out.println("--------------------------------------12Stored start -> end: " 
                        + potentialfurtherAscendingBeyondThisStart + "->" + potentialfurtherAscendingBeyondThisEnd);                                              
                    }
                    
                    if (k!=0)
                    {
                        if ((Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon))
                        {
                            transitionNumber=String.valueOf(nums[k]);
                            System.out.println("2Transition number: " + transitionNumber + " descending(difference) on either side");
                            
                             if ((potentialfurtherAscendingBeyondThisEnd!="")
                             && (potentialfurtherAscendingBeyondThisEnd!=""))
                            {
                                System.out.println("19821982using stored start");
                                end=String.valueOf(nums[k]);
                                sm.add(potentialfurtherAscendingBeyondThisStart+"->"+end);
				
				System.out.println("***1INVESTIGATE THIS DURING TEST - Mismatch between values passed into test and List******");
				System.out.println("***It might impact ticker ONLY******");

                                System.out.println("197618cWriting range: " + potentialfurtherAscendingBeyondThisStart+"->"+end);
                                completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                                potentialfurtherAscendingBeyondThisEnd="";
                                potentialfurtherAscendingBeyondThisStart="";
                        
                                start=String.valueOf(nums[k]);
                                end=String.valueOf(nums[k+1]);
                                        
                                potentialfurtherAscendingBeyondThisStart = start; 
                                potentialfurtherAscendingBeyondThisEnd = end;
                                System.out.println("--------------------------------------007Stored start -> end: " + potentialfurtherAscendingBeyondThisStart + "->" + potentialfurtherAscendingBeyondThisEnd);
                        
                                hasWrittenStoreDueTransition=true;
                            }
                        }
                    }
                        
                    if (counter==0)
                    {
                        backupStart=String.valueOf(nums[k]);
                    }
                        
                    if (counter==0 && (k==nums.length-2))
                    {
                        if (sm.isEmpty() && !isFirstOccurenceAscendingChain 
                        && !(potentialfurtherAscendingBeyondThisStart=="") 
                        && !(potentialfurtherAscendingBeyondThisEnd==""))
                        {
                            sm.add(potentialfurtherAscendingBeyondThisStart+"->"+nums[k]);
                            
                            System.out.println("--------------------1980USING STORED TO WRITE RANGE");
                            System.out.println("99943434Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + nums[k]);
                            completeTicker(potentialfurtherAscendingBeyondThisStart,String.valueOf(nums[k]),k,lengthNums);
                            potentialfurtherAscendingBeyondThisStart="";
                            potentialfurtherAscendingBeyondThisEnd="";
                        }
                        
                        start=String.valueOf(nums[k]);
                        end = String.valueOf(nums[k+1]);
                        
                        if (!(potentialfurtherAscendingBeyondThisStart=="") 
                        && !(potentialfurtherAscendingBeyondThisEnd==""))
                        {
                            sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                            System.out.println("--------------------001980USING STORED TO WRITE RANGE");
                            System.out.println("4343466Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + potentialfurtherAscendingBeyondThisEnd);
                            completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                            potentialfurtherAscendingBeyondThisStart="";
                            potentialfurtherAscendingBeyondThisEnd="";
                            hasWrittenRepeatNumber=true;
                        }
                        
                        if (k==nums.length-2 && !hasWrittenRepeatNumber)
                        {
                            sm.add(start+"->"+end);
                            System.out.println("5Writing range: " + start + "-> " + end);
                            descendingCounter++;
                            completeTicker(start,end,k,lengthNums);
                            isFirstOccurenceAscendingChain=false;
                            isFirstOccurenceAscendingChainNoTransition =false;
                        }
                        else
                        {
                            if ((potentialfurtherAscendingBeyondThisStart=="")
                            && (potentialfurtherAscendingBeyondThisEnd=="")
                            && (hasWrittenRepeatNumber))
                            {
                                start=String.valueOf(nums[k]);
                                end=String.valueOf(nums[k+1]);
                                System.out.println("9711111Writing range: " + start + "-> " + end);
                                sm.add(start+"->" + end);
                                completeTicker(start,end,k,lengthNums);
                                break;
                            }
                            
                            if (!hasWrittenRepeatNumber)
                            {
                                sm.add(start+"->"+end);
                                System.out.println("5aWriting range: " + start + "-> " + end);
                                descendingCounter++;
                                completeTicker(start,end,k,lengthNums);
                                isFirstOccurenceAscendingChain=false;
                                isFirstOccurenceAscendingChainNoTransition =false;
                            }
                        }
                      
                        if(!(potentialfurtherAscendingBeyondThisStart=="") 
                        && !(potentialfurtherAscendingBeyondThisEnd=="") 
                        && (isFirstOccurenceAscendingChain))
                        {
                            if (nums[k]!=nums[k-1])
                            {
                                sm.add(potentialfurtherAscendingBeyondThisStart+"->"+nums[k]);
                                System.out.println("--------------------2322USING STORED TO WRITE RANGE");
                                System.out.println("97052Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + nums[k]);
                                descendingCounter=0;
                            
                                completeTicker(potentialfurtherAscendingBeyondThisStart,String.valueOf(nums[k]),k,lengthNums);
                            }
                            potentialfurtherAscendingBeyondThisStart="";
                            potentialfurtherAscendingBeyondThisEnd="";
                        }
                        
                        hasWrittenRepeatNumber=false;
                        break;
                    } 
                    
                    if (counter!=0 && (k==nums.length-2))
                    {
                        end=String.valueOf(nums[k+1]);
                        sm.add(start +"->"+end);
                        System.out.println("6Writing range: " + start + "-> " + end);
                        hasStandaloneAfter=false;
                        descendingCounter++;
                        completeTicker(start,end,k,lengthNums);
                    }
                    if (counter==0)
                    {
                        if (isFirstOccurenceAscendingChainNoTransition || isFirstOccurenceAscendingChain)
                        {
                            if ((potentialfurtherAscendingBeyondThisEnd=="")
                            && (potentialfurtherAscendingBeyondThisStart=="")
                            && !(hasWrittenStoreDueTransition))
                            {
                                end=String.valueOf(nums[k]);
                                sm.add(start+"->"+end);
                                System.out.println("28Writing range: " + start + "-> " + end);
                                isFirstOccurenceAscendingChain=false;
                                isFirstOccurenceAscendingChainNoTransition =false;
                                ascendingCounter++;
                                completeTicker(start,end,k,lengthNums);
                                potentialfurtherAscendingBeyondThisEnd="";
                                potentialfurtherAscendingBeyondThisStart="";
                            }
                            hasWrittenStoreDueTransition=true;
                        }
                        else
                        {
                            if (String.valueOf(nums[k+1]).equals(potentialfurtherAscendingBeyondThisStart))
                            {
                                System.out.println("123456using stored start");
                                sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                System.out.println("197618bWriting range: " + potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                ascendingCounter++;
                                    
                                completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                                potentialfurtherAscendingBeyondThisStart="";
                                potentialfurtherAscendingBeyondThisEnd="";
                            }
                        }
                        start=String.valueOf(nums[k]);
                            
                        if (k==nums.length-1)
                        {
                            System.out.println("2Writing Standalone: " + start);
                            sm.add(start);
                            completeTicker(start, start,k,lengthNums);
                        }
                    }
                    
                    if (k>=1)
                    {
                        if ((nums[k]==nums[k-1])
                        && !(Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                        && !(Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon))
                        {
                            System.out.println("Writing Standalone: " + start);
                            sm.add(start);
                            completeTicker(start, start,k,lengthNums);
                        }
                    }
                    
                    counter++; 
                }
                else
                {
                    if (k==nums.length-2)
                    {
                        System.out.println("k=nums.length-2");
                        
                        if (temp!="")
                        {
                            sm.add(temp);
                            System.out.println("9Writing range: " + temp);
                            completeTicker(backupStart,end,k,lengthNums);  //NEW CODE LATE
                            isFirstOccurenceAscendingChain=false;
                            isFirstOccurenceAscendingChainNoTransition =false;
                        }
                        
                        if (counter==0)
                        {
                            if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                            {
                                System.out.println("next number descending (difference)");
                                start=String.valueOf(nums[k]);
                                end = String.valueOf(nums[k+1]);
                                sm.add(start+"->"+end);
                                completeTicker(start,end,k,lengthNums);
                                System.out.println("7Writing range: " + start + "-> " + end);
                                isFirstOccurenceAscendingChain=false;
                                isFirstOccurenceAscendingChainNoTransition =false;
                            }
                            else
                            {
                                end = String.valueOf(nums[k]);
                            
                                if (isFirstOccurenceAscendingChainNoTransition || isFirstOccurenceAscendingChain)
                                {
                                    if (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                                    {   
                                        if (!(potentialfurtherAscendingBeyondThisStart=="") 
                                        && !(potentialfurtherAscendingBeyondThisEnd=="")
                                        && (nums[k]==nums[k-1]))
                                        {
                                            sm.add(potentialfurtherAscendingBeyondThisStart+"->"+String.valueOf(nums[k]));
                                            System.out.println("--------------------47171USING STORED TO WRITE RANGE");
                                            System.out.println("41717Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + nums[k]);
                                            System.out.println(sm);
                                            completeTicker(potentialfurtherAscendingBeyondThisStart,String.valueOf(nums[k]),k,lengthNums);
                                        }
                                        else
                                        {
                                            potentialfurtherAscendingBeyondThisStart="";
                                            potentialfurtherAscendingBeyondThisEnd="";
                                        }
                                        
                                        if (potentialfurtherAscendingBeyondThisEnd!="" && potentialfurtherAscendingBeyondThisEnd!="")
                                        {
                                            System.out.println("091090using stored start");
                                            sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                            System.out.println("091090aWriting range: " + potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                        
                                            completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                                            potentialfurtherAscendingBeyondThisStart="";
                                            potentialfurtherAscendingBeyondThisEnd="";
                                        }
                                        
                                        System.out.println("next number ascending (difference)");
                                        end=String.valueOf(nums[k+1]);
                                        sm.add(start+"->"+end);
                                                   
                                        System.out.println("35Writing range: " + start + "-> " + end);
                                        ascendingCounter++;
                                        completeTicker(start,end,k,lengthNums);
                                        hasNotWrittenLastNumber=false;
                                        isFirstOccurenceAscendingChain=false;
                                        isFirstOccurenceAscendingChainNoTransition =false;
                                        ascendingCounter++;
                                    }
                                    else
                                    {
                                        end=String.valueOf(nums[k]);
                                        sm.add(start+"->"+end);
                                        System.out.println("27Writing range: " + start + "-> " + end);
                                        completeTicker(start,end,k,lengthNums);
                                    }
                                }     
                                else 
                                {
                                    if (temp=="")
                                    {
                                        if (nums.length==2)
                                        {
                                            if ((Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon) 
                                            || (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon))
                                            {
                                                System.out.println("next number ascending(difference) AND/OR descending (difference)");
                                                start=String.valueOf(nums[k]);
                                                end=String.valueOf(nums[k+1]);
                                                sm.add(start+"->"+end);
                                                System.out.println("2678Writing range, only two ascending numbers in array: " + start + "-> " + end);
                                                completeTicker(start, end,k,lengthNums);
                                                
                                                break;
                                            }
                                            else
                                            {
                                                System.out.println("next number NOT within difference");
                                                start=String.valueOf(nums[k]);
                                                
                                                sm.add(start);    
                                                System.out.println("234Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                                
                                                start=String.valueOf(nums[k+1]);
                                                sm.add(start);
                                                    
                                                System.out.println("2348Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                                    
                                                break;
                                            }
                                        }
                                        
                                        if (Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon)
                                        {
                                            System.out.println("previous number descending (difference)");
                                                
                                            if (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                                            {
                                                System.out.println("next number ascending (difference)");
                                                ascendingCounter++;
                                                
                                                if (writtenPrevious)
                                                {
                                                    start=potentialfurtherAscendingBeyondThisStart;
                                                    end=String.valueOf(nums[k+1]);
                                                    sm.add(start+"->"+end);
                                                        
                                                    System.out.println("6098Writing range: " + start + "-> " + end);
                                                    completeTicker(start, end,k,lengthNums);
                                                }
                                                else
                                                {
                                                    start=String.valueOf(nums[k-1]);
                                                    end=String.valueOf(nums[k+1]);
                                                    sm.add(start+"->"+end);
                                                    System.out.println("9876Writing range: " + start + "-> " + end);
                                                    completeTicker(start,end,k,lengthNums);
                                    
                                                    potentialfurtherAscendingBeyondThisStart="";
                                                    potentialfurtherAscendingBeyondThisStart="";
                                                }
                                                writtenPrevious=false;
                                            }
                                            else
                                            {
                                                if (writtenPrevious)
                                                {
                                                    System.out.println("6111using stored start");
                                                    sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                                    System.out.println("197618aWriting range: " + potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                                    writtenPrevious=false;
                                                    completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                                                    potentialfurtherAscendingBeyondThisStart="";
                                                    potentialfurtherAscendingBeyondThisEnd="";
                                                }
                                                
                                                if (k==1 && nums.length>=3)
                                                {
                                                    start=String.valueOf(nums[k-1]);
                                                    end=String.valueOf(nums[k]);
                                                    sm.add(start+"->"+end);    
                                                
                                                    System.out.println("00000Writing range: " + start+"->"+end);
                                                    completeTicker(start,end,k,lengthNums);
                                                }
                                                
                                                if (k+1==nums.length-1)
                                                {
                                                    start=String.valueOf(nums[k+1]);
                                                    sm.add(start);
                                                    System.out.println("0241Writing Standalone: " + start);
                                                    System.out.println("The last number in the array");
                                                    completeTicker(start, start,k,lengthNums);
                                                        
                                                    break;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!(Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon))
                                            {
                                                System.out.println("previous number not descending (difference)");
                                                System.out.println("next number ascending (difference)");
                                                start=String.valueOf(nums[k]);
                                                sm.add(start);
                                                System.out.println("009Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                            
                                                start=String.valueOf(nums[k+1]);
                                                sm.add(start);
                                                System.out.println("0089Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                            }
                                            else
                                            {
                                                System.out.println("previous number (not within difference), next number (difference)");
                                                
                                                if(!(potentialfurtherAscendingBeyondThisStart=="") 
                                                && !(potentialfurtherAscendingBeyondThisEnd=="") 
                                                && (isFirstOccurenceAscendingChain))
                                                {
                                                    sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                                    System.out.println("--------------------2322USING STORED");
                                                    System.out.println("2025Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + potentialfurtherAscendingBeyondThisEnd);
                                                }
                                                start=String.valueOf(nums[k]);
                                                end=String.valueOf(nums[k+1]);
                                                sm.add(start+"->"+end);
                                                    
                                                System.out.println("1992Writing range: " + start + "-> " + end);
                                                ascendingCounter++;
                                                completeTicker(start,end,k,lengthNums);
                                                isFirstOccurenceAscendingChain=false;
                                                isFirstOccurenceAscendingChainNoTransition=false;
                                            }
                                        }
                                        combineMerge=true;
                                    }
                                }
                                
                                if (hasNotWrittenLastNumber && !combineMerge)
                                {
                                    start=String.valueOf(nums[k+1]);
                                    System.out.println("4Writing Standalone: " + start);
                                    sm.add(start);
                                    completeTicker(start, start,k,lengthNums);
                                    hasNotWrittenLastNumber=false;
                                }
                            }
                        }
                        else   
                        {
                            if (!(potentialfurtherAscendingBeyondThisEnd.equals("")) && !(potentialfurtherAscendingBeyondThisStart.equals("")))
                            {
                                
                                if ( ((Math.abs(nums[k] - Float.valueOf(potentialfurtherAscendingBeyondThisEnd) + difference)) <epsilon))
                                {
                                    System.out.println("7using stored start--------------------------------------------------------------");
                                    start=potentialfurtherAscendingBeyondThisStart;
                                    
                                    sm.add(start+"->"+String.valueOf(nums[k]));
                                    System.out.println("3aWriting range: " + start + "-> " + end);
                                    completeTicker(start,end,k,lengthNums);
                                }
                                else
                                {
                                    System.out.println("7using stored start--------------------------------------------------------------");
                                    start=potentialfurtherAscendingBeyondThisStart;
                                    end=String.valueOf(nums[k]);
                                    sm.add(start+"->"+end);
                                    System.out.println("3Writing range: " + start + "-> " + end);
                                    completeTicker(start,end,k,lengthNums);
                                }
                                potentialfurtherAscendingBeyondThisStart="";
                                potentialfurtherAscendingBeyondThisEnd="";
                            }
                            else
                            {
                                if (nums[k]!=nums[k-1])
                                {
                                    start=String.valueOf(nums[k-1]);
                                    end=String.valueOf(nums[k]);
                                    sm.add(start+"->"+end);
                                    System.out.println("3mWriting range: " + start + "-> " + end);
                                    completeTicker(start,end,k,lengthNums);
                                }
                            }
                            
                            if ((Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                            ||   (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon))
                            {
                                System.out.println("ascending/descending next number (diffference)");
                                start=String.valueOf(nums[k]);
                                end=String.valueOf(nums[k+1]);
                                sm.add(start+"->"+end);
                                System.out.println("49Writing range: " + start + "-> " + end);
                                completeTicker(start,end,k,lengthNums);
                                isFirstOccurenceAscendingChain=false;
                                isFirstOccurenceAscendingChainNoTransition =false;
                            }
                            else
                            {
                                System.out.println("Next number not within difference");
                                start=String.valueOf(nums[k+1]);
                                sm.add(start);
                                System.out.println("599Writing standalone: " + start);
                                completeTicker(start, start,k,lengthNums);
                            }
                        }
                    }
                    else
                    {
                        if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                        {
                            System.out.println("next number descending (difference)");
                            end=String.valueOf(nums[k+1]);
                        }
                        else
                        {
                            System.out.println("1next number not descending (difference)");
                            end=String.valueOf(nums[k]);
                        }
                        
                        System.out.println("This is counter at the moment:  " + counter);
                        
                        if (counter==0)
                        {
                            if(k==0)
                            {
                                if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                                {
                                    System.out.println("next number descending (difference)");
                                    
                                    if (writtenPrevious)
                                    {
                                        System.out.println("7777using stored start");
                                        sm.add(potentialfurtherAscendingBeyondThisStart+"->"+end);
                                        System.out.println("197617Writing range: " + start+"->"+end);
                                        completeTicker(potentialfurtherAscendingBeyondThisStart,end,k,lengthNums);
                                        writtenPrevious=false;
                                        potentialfurtherAscendingBeyondThisStart="";
                                        potentialfurtherAscendingBeyondThisEnd="";
                                    }
                                    start=String.valueOf(nums[k]);
                                    counter++;
                                }
                                else
                                {
                                    if (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                                    {
                                        System.out.println("next number ascending (difference)");
                                        ascendingCounter++;
                                        start=String.valueOf(nums[k]);
                                        end=String.valueOf(nums[k+1]);
                                        
                                        potentialfurtherAscendingBeyondThisStart = start; 
                                        potentialfurtherAscendingBeyondThisEnd = end;
                                        System.out.println("--------------------------------------0Stored start -> end: " + start + "->" + end);
                                        
                                        isFirstOccurenceAscendingChain=false;
                                        isFirstOccurenceAscendingChainNoTransition =false;
                                    }
                                    else
                                    {
                                        System.out.println("2next number NOT within difference");
                                        System.out.println("5Writing standalone: " + start);
                                        sm.add(start);
                                        completeTicker(start, start,k,lengthNums);
                                    }
                                }
                            }
                            else
                            {
                                if (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)
                                {
                                    System.out.println("next number descending (difference)");
                                    if (temp=="")
                                    {
                                        if (Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon)
                                        {
                                            System.out.println("previous number descending (difference)");
                                            backupStart=String.valueOf(nums[k-1]);
                                        }
                                        else
                                        {
                                            backupStart=String.valueOf(nums[k]);
                                        }
                                        temp=backupStart+"->"+end;
                                        hasTransition=false;
                                    }
                                    else
                                    {
                                        end=String.valueOf(nums[k+1]);
                                        temp=backupStart+"->"+end;
                                        hasTransition=false;
                                    }
                                    System.out.println("8Storing range: " + temp);
                                }
                                else
                                {
                                    System.out.println("2next number not descending (difference)");
                                        
                                    if(temp!="")
                                    {
                                        sm.add(temp);
                                        System.out.println("8Writing range: " + temp);
                                        temp="";
                                        backupStart="";
                                        isFirstOccurenceAscendingChain=false;
                                        isFirstOccurenceAscendingChainNoTransition =false;
                                    }
                                    else
                                    {
                                        if ((Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon) 
                                        || (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon))
                                        {
                                            System.out.println("previous number descending(difference) AND/OR next number ascending (difference)");
                                            end = String.valueOf(nums[k]);
                                            
                                            if (nums[k]==nums[k-1] && !hasWrittenRepeatNumber)
                                            {
                                                System.out.println("Previous number same as current");
                                                start = String.valueOf(nums[k-1]);
                                                sm.add(start);
                                                System.out.println("6Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                            }
                                            
                                            hasWrittenRepeatNumber=false;
                                                
                                            if  (Math.abs(nums[k] - (nums[k+1] - difference))<epsilon)
                                            {
                                                System.out.println("Next number ascending");
                                                ascendingCounter++;
                                                
                                                if (!isFirstOccurenceAscendingChainNoTransition)
                                                {
                                                    start=String.valueOf(nums[k]);
                                                    
                                                    isFirstOccurenceAscendingChainNoTransition=true;
                                                }
                                                    
                                                if (isFirstOccurenceAscendingChainNoTransition 
                                                && (potentialfurtherAscendingBeyondThisStart.equals("")) 
                                                && (potentialfurtherAscendingBeyondThisEnd.equals("")))
                                                {
                                                    start=String.valueOf(nums[k]);
                                                    end=String.valueOf(nums[k+1]);
                                        
                                                    potentialfurtherAscendingBeyondThisStart = start; 
                                                    potentialfurtherAscendingBeyondThisEnd = end;
                                                   
                                                    System.out.println("--------------------------------------22Stored start -> end: " + start + "->" + end);
                                                }
                                                    
                                                if ((Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon) 
                                                && (Math.abs(nums[k] - (nums[k+1] - difference))<epsilon))
                                                {
                                                    System.out.println("Previous number descending (difference) AND next number ascending (difference)");
                                                        
                                                    if (!isFirstOccurenceAscendingChain)
                                                    {
                                                        start=String.valueOf(nums[k-1]);
                                                        isFirstOccurenceAscendingChain=true;
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                System.out.println("next item is NOT ascending(difference)");
                                                
                                                if (!potentialfurtherAscendingBeyondThisStart.equals("") 
                                                && !(potentialfurtherAscendingBeyondThisEnd.equals("")))
                                                {
                                                    System.out.println("using stored start");
                                                    sm.add(start+"->"+end);
                                                    System.out.println("197619Writing range: " + start+"->"+end);
                                                    ascendingCounter++;
                                                    completeTicker(start,end,k,lengthNums);
                                                }
                                                else
                                                {
                                                    sm.add(start+"->"+end);
                                                    System.out.println("1541Writing range: " + start+"->"+end);
                                                    completeTicker(start,end,k,lengthNums);
                                                }
                                                potentialfurtherAscendingBeyondThisEnd="";
                                                potentialfurtherAscendingBeyondThisStart="";
                                                isFirstOccurenceAscendingChain=false;
                                                isFirstOccurenceAscendingChainNoTransition=false;
                                                isFirstOccurenceAscendingChain=false;
                                                isFirstOccurenceAscendingChainNoTransition =false;
                                            }
                                        }
                                        else  
                                        {
                                            System.out.println("previous number ascending (difference) OR next number descending(difference)");
                                            
                                            if (potentialfurtherAscendingBeyondThisStart!="" && potentialfurtherAscendingBeyondThisEnd!="")
                                            {
                                                System.out.println("using stored start");
                                                sm.add(potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
System.out.println("888881Writing range: " +potentialfurtherAscendingBeyondThisStart+"->"+potentialfurtherAscendingBeyondThisEnd);
                                                potentialfurtherAscendingBeyondThisEnd="";
                                                potentialfurtherAscendingBeyondThisStart="";
                                            }
                                            else
                                            {
                                                start = String.valueOf(nums[k]);
                                                sm.add(start);
                                                System.out.println("6Writing Standalone: " + start);
                                                completeTicker(start, start,k,lengthNums);
                                                isFirstOccurenceAscendingChain=false;
                                                isFirstOccurenceAscendingChainNoTransition=false;
                                            }
                                        }
                                    }  
                                }
                            }
                        }
                        else                        
                        {
                            System.out.println("counter is not zero");                         
                                
                            if ((Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon)  
                            && (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon))
                            {
                                System.out.println("next number descending (difference) AND previous number descending (difference)");
                                end=String.valueOf(nums[k]);
                                sm.add(backupStart+"->"+end);
                                System.out.println("10Writing range: " + backupStart+"->"+end);
                                hasTransition=true;
                                System.out.println(" 12hasTransition set to true");
                                transitionNumber=String.valueOf(nums[k]);
                                System.out.println("1Transition number: " + transitionNumber + " descending(difference) on either side");
                                
                                isFirstOccurenceAscendingChain=false;
                                isFirstOccurenceAscendingChainNoTransition =false;
                            }
                            
                            if ((Math.abs(nums[k] - (nums[k-1] - difference)) <epsilon)  
                            && (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon))
                            {
                                transitionNumber=String.valueOf(nums[k]);
                                System.out.println("Transition number: " + transitionNumber + " ascending(difference) on either side");
                                System.out.println("next number ascending (difference) AND previous number descending (difference");
                            }
                            
                            if (!hasTransition)
                            {
                                if (temp!="")
                                {
                                    end=String.valueOf(nums[k+1]);
                                    sm.add(start+"->"+end);
                                    System.out.println("-------------------Writing range: " + start+"->"+end);
                                }
                                else
                                {
                                    System.out.println("COUNTER VALUE: " + counter);
                                                     
                                    if ((Math.abs(nums[k] - (nums[k-1] - difference)) <epsilon) 
                                    && (Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon))
                                    {
                                        System.out.println("previous number ascending (difference) AND next number ascending (difference)");
                                        
                                        
                                        if (potentialfurtherAscendingBeyondThisStart!="" && potentialfurtherAscendingBeyondThisEnd!="")
                                        {
                                            System.out.println("--------------------9999 STORED TO WRITE RANGE");
                                            System.out.println("3121Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + end);
                                            sm.add(potentialfurtherAscendingBeyondThisStart+"->"+end);
                                            completeTicker(potentialfurtherAscendingBeyondThisStart,end,k,lengthNums);
                                            end=String.valueOf(nums[k+1]);
                                            start=String.valueOf(nums[k]);
                                            potentialfurtherAscendingBeyondThisStart="";
                                            potentialfurtherAscendingBeyondThisEnd="";
                                        }
                                        
                                        ascendingCounter++;
                                        
                                        potentialfurtherAscendingBeyondThisStart=String.valueOf(nums[k]);
                                        potentialfurtherAscendingBeyondThisEnd=String.valueOf(nums[k+1]);
                                        
                                        System.out.println("--------------------------------------1Stored start -> end: " + start + "->" + end);
                                            
                                        writtenPrevious=true;
                                    }
                                    else
                                    {
                                        System.out.println("previous number AND/OR next number not ascending(difference)");
                                       
                                       if ((potentialfurtherAscendingBeyondThisStart!="") 
                                       && (potentialfurtherAscendingBeyondThisEnd!=""))
                                       {
                                            if ((Math.abs(nums[k] - (nums[k-1] - difference)) <epsilon) 
                                            || (Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon))
                                            {
                                                System.out.println("--------------------55555USING STORED TO WRITE RANGE");
                                                System.out.println("2aWriting range: " + potentialfurtherAscendingBeyondThisStart + "-> " + String.valueOf(nums[k]));
                                                sm.add(potentialfurtherAscendingBeyondThisStart + "-> " + String.valueOf(nums[k]));
                                                completeTicker(potentialfurtherAscendingBeyondThisStart,String.valueOf(nums[k]),k,lengthNums);
                                                potentialfurtherAscendingBeyondThisStart="";
                                                potentialfurtherAscendingBeyondThisEnd="";
                                            }  
                                        }
                                        else
                                        {
                                            if ((Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon) 
                                            && (Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon))
                                            {
                                                System.out.println("2bWriting range: " + start + "-> " + end);
                                                sm.add(start+"->"+end);
                                                completeTicker(start,end,k,lengthNums);
                                            }
                                            else
                                            {
                                                if ((nums[k]==nums[k-1])
                                                &&  !(Math.abs(nums[k] - (nums[k+1] - difference)) <epsilon)
                                                && !(Math.abs(nums[k] - (nums[k+1] + difference)) <epsilon)) 
                                                {
                                                    start = String.valueOf(nums[k]);
                                                    sm.add(start);
                                                    System.out.println("8888888888Writing Standalone: " + start);
                                                    completeTicker(start, start,k,lengthNums);
                                                }
                                            }
                                            
                                        }
                                    }
                                    isFirstOccurenceAscendingChain=false;   
                                    isFirstOccurenceAscendingChainNoTransition =false;
                                }
                            }
                            counter=0;
                            temp="";
                            backupStart="";
                            hasTransition=false;
                        }
                    }
                }
            }
            else
            {
                System.out.println("\nCHECKING: " + nums[k] + " with " + nums[k+1]);
                System.out.println("REPEAT NUMBER");
                
                
                if (k==(nums.length-2))
                {
                    if ((Math.abs(nums[k] - (nums[k-1] - difference)) <epsilon) 
                    && (potentialfurtherAscendingBeyondThisStart.equals(""))  
                    && (potentialfurtherAscendingBeyondThisEnd.equals("")))
                    {
                        System.out.println("Previous number ascending (difference)");
                        start=String.valueOf(nums[k-1]);
                        end=String.valueOf(nums[k]);
                                
                        System.out.println("97053Writing range: " + start + "-> " + end);
                        sm.add(start+"->"+end);                      
                    }
                    
                    if (!potentialfurtherAscendingBeyondThisStart.equals("") 
                    && !(potentialfurtherAscendingBeyondThisEnd.equals("")))
                    {
                        sm.add(potentialfurtherAscendingBeyondThisStart+"->"+nums[k]);
                        System.out.println("--------------------23229USING STORED TO WRITE RANGE");
                        System.out.println("9705Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + nums[k]);
                        completeTicker(potentialfurtherAscendingBeyondThisStart,potentialfurtherAscendingBeyondThisEnd,k,lengthNums);
                        potentialfurtherAscendingBeyondThisStart="";
                        potentialfurtherAscendingBeyondThisEnd="";
                    }
                    else
                    {
                        start = String.valueOf(nums[k]);
                        sm.add(start);
                        System.out.println("07774544Writing Standalone: " + start);
                        completeTicker(start, start,k,lengthNums);
                    }
                }
                
                start = String.valueOf(nums[k]);
                    
                if (potentialfurtherAscendingBeyondThisStart=="" && potentialfurtherAscendingBeyondThisEnd=="")
                {
                    if (k==0)
                    {
                        if(nums[k]==nums[k+1])
                        {
                            sm.add(start);
                            System.out.println("066666Writing Standalone: " + start);
                            completeTicker(start, start,k,lengthNums);
                            hasWrittenRepeatNumber=true;
                        }
                    }
                        
                    if (k>0)
                    {
                        if (nums[k]==nums[k-1] || nums[k]==nums[k+1])
                        {
                            sm.add(start);
                            System.out.println("019238475Writing Standalone: " + start);
                            completeTicker(start, start,k,lengthNums);
                            hasWrittenRepeatNumber=true;
                        }
                    }
                }
                    
                else
                {
                    if((Math.abs(nums[k] - (nums[k-1] - difference)) <epsilon)
                    || (Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon))
                    {
                        if ((Math.abs(nums[k] - (nums[k-1] + difference)) <epsilon))
                        {
                            ascendingCounter++;
                        }
                            
                        sm.add(potentialfurtherAscendingBeyondThisStart+"->"+nums[k]);
                        System.out.println("--------------------23229USING STORED TO WRITE RANGE");
                        System.out.println("-1010Writing range: " + potentialfurtherAscendingBeyondThisStart + "-> " + nums[k]);
                        completeTicker(potentialfurtherAscendingBeyondThisStart,String.valueOf(nums[k]),k,lengthNums);
                        hasWrittenRepeatNumber=true;
                        
                        potentialfurtherAscendingBeyondThisStart="";
                        potentialfurtherAscendingBeyondThisEnd="";
                        
                        if (String.valueOf(nums[k+1]).equals(potentialfurtherAscendingBeyondThisEnd))
                        {
                            sm.add(start);
                            System.out.println("0690690695Writing Standalone: " + start);
                            completeTicker(start, start,k,lengthNums);
                        }
                    }
                    else
                    {
                        standaloneTemp = start;
                    }
                }
            }  
        }
        System.out.println("\nTICKER: " + completeTicker("END","END",0,lengthNums));
        return sm;
    }
}