def MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

return int ( ( .25 * ( ( 13 / 10 ) * ( Attack+Strength ) +Defense+Constitution+ ( .5 *Prayer ) ) ) // 1 )

def MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

return int ( ( .25 * ( ( 13 / 10 ) * ( ( 3 / 2 ) *Magic ) +Defense+Constitution+ ( .5 *Prayer ) ) ) // 1 )

def RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

return int ( ( .25 * ( ( 13 / 10 ) * ( ( 3 / 2 ) *Range ) +Defense+Constitution+ ( .5 *Prayer ) ) ) // 1 )

def NextLevelMeleeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Me+ 1 == MeleeLevel ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelMeleeAttStr ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer )

def NextLevelMeleeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Me+ 1 == MeleeLevel ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelMeleeDefCon ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer )

def NextLevelMeleePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Me+ 1 == MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 ) : return 1

else : return 1 +NextLevelMeleePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 )

def NextLevelMeleeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer ) == Me+ 1 : return 1

else : return 1 +NextLevelMeleeMage ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer )

def NextLevelMeleeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if RangeLevel ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer ) == Me+ 1 : return 1

else : return 1 +NextLevelMeleeRange ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer )

def NextLevelMagicAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ma+ 1 == MeleeLevel ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelMagicAttStr ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer )

def NextLevelMagicDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ma+ 1 == MagicLevel ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelMagicDefCon ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer )

def NextLevelMagicPray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ma+ 1 == MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 ) : return 1

else : return 1 +NextLevelMagicPray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 )

def NextLevelMagicMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ma+ 1 == MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer ) : return 1

else : return 1 +NextLevelMagicMage ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer )

def NextLevelMagicRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if RangeLevel ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer ) == Ma+ 1 : return 1

else : return 1 +NextLevelMagicRange ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer )

def NextLevelRangeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ra+ 1 == MeleeLevel ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelRangeAttStr ( Attack+ 1 , Strength , Defense , Constitution , Range , Magic , Prayer )

def NextLevelRangeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ra+ 1 == RangeLevel ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer ) : return 1

else : return 1 +NextLevelRangeDefCon ( Attack , Strength , Defense+ 1 , Constitution , Range , Magic , Prayer )

def NextLevelRangePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ra+ 1 == RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 ) : return 1

else : return 1 +NextLevelRangePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer+ 1 )

def NextLevelRangeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if Ra+ 1 == MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer ) : return 1

else : return 1 +NextLevelRangeMage ( Attack , Strength , Defense , Constitution , Range , Magic+ 1 , Prayer )

def NextLevelRangeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

if RangeLevel ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer ) == Ra+ 1 : return 1

else : return 1 +NextLevelRangeRange ( Attack , Strength , Defense , Constitution , Range+ 1 , Magic , Prayer )

def RSLevel ( ) :

Attack = int ( input ( "Attack Level: " ) )

Strength = int ( input ( "Strength Level: " ) )

Defense = int ( input ( "Defense Level: " ) )

Constitution = int ( input ( "Constitution Level: " ) )

Range = int ( input ( "Range Level: " ) )

Magic = int ( input ( "Magic Level: " ) )

Prayer = int ( input ( "Prayer Level: " ) )

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

return RSLevelRaw ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

def RSLevelRaw ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) :

Me = MeleeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

Ma = MagicLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

Ra = RangeLevel ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer )

print ( "" )

print ( "Your combat level is " + str ( max ( [ Me , Ma , Ra ] ) ) )

print ( "" )

if Me == max ( [ Me , Ma , Ra ] ) :

if Me == 126 : print ( "You have reached the maximum level in F2P Runescape, congrats!" )

else :

print ( "To get to level " + str ( Me+ 1 ) + ", you need to achieve one of these:" )

if ( NextLevelMeleeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Attack+Strength < ( 99 * 2 ) :

print ( " " + str ( NextLevelMeleeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Attack or Strength Levels" )

if ( NextLevelMeleeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Defense+Constitution < ( 99 * 2 ) :

print ( " " + str ( NextLevelMeleeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Defense or Constitution Levels" )

if NextLevelMeleePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Prayer < 99 :

print ( " " + str ( NextLevelMeleePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Prayer Levels" )

if NextLevelMeleeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Magic < 99 :

print ( " " + str ( NextLevelMeleeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Magic Levels" )

if NextLevelMeleeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Range < 99 :

print ( " " + str ( NextLevelMeleeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Range Levels" )

print ( "Your combat level is melee based" )

elif Ma == max ( [ Me , Ma , Ra ] ) :

print ( "To get to level " + str ( Ma+ 1 ) + ", you need:" )

if ( NextLevelMagicAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Attack+Strength < ( 99 * 2 ) :

print ( " " + str ( NextLevelMagicAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Attack or Strength Levels" )

if ( NextLevelMagicDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Defense+Constitution < ( 99 * 2 ) :

print ( " " + str ( NextLevelMagicDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Defense or Constitution Levels" )

if NextLevelMagicPray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Prayer < 99 :

print ( " " + str ( NextLevelMagicPray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Prayer Levels" )

if NextLevelMagicMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Magic < 99 :

print ( " " + str ( NextLevelMagicMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Magic Levels" )

if NextLevelMagicRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) < 99 :

print ( " " + str ( NextLevelMagicRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Range Levels" )

print ( "Your combat level is magic based" )

elif Ra == max ( [ Me , Ma , Ra ] ) :

print ( "To get to level " + str ( Ra+ 1 ) + ", you need:" )

if ( NextLevelRangeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Attack+Strength < ( 99 * 2 ) :

print ( " " + str ( NextLevelRangeAttStr ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Attack or Strength Levels" )

if ( NextLevelRangeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) +Defense+Constitution < ( 99 * 2 ) :

print ( " " + str ( NextLevelRangeDefCon ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Defense or Constitution Levels" )

if NextLevelRangePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Prayer < 99 :

print ( " " + str ( NextLevelRangePray ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Prayer Levels" )

if NextLevelRangeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) +Magic < 99 :

print ( " " + str ( NextLevelRangeMage ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Magic Levels" )

if NextLevelRangeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) < 99 :

print ( " " + str ( NextLevelRangeRange ( Attack , Strength , Defense , Constitution , Range , Magic , Prayer ) ) + " Range Levels" )