najduzi_strogo_rastuci_podniz n = nsrp n 0 0 10 0 10 0

max2 a b = if a>b then a else b

nsrp n maks t cif br st maksbr = if n==0 
	then maksbr
	else(	if (mod n 10) < cif 
				then ( if maks>(t+1)
							then nsrp (n `div` 10) maks (t+1) (mod n 10) (br+st*(mod n 10)) (st*10) maksbr
							else nsrp (n `div` 10) (t+1) (t+1) (mod n 10) (br+st*(mod n 10)) (st*10) (br+st*(mod n 10))
					) 	
				else nsrp (n `div` 10) maks 1 (mod n 10) (mod n 10) 10 maksbr
		)

	