Need help is manipulating a file with some arithmetic operations using bash script

Friends,
I have a file with contents like:

interface Serial0/4/0/0/1/1/1/1:0
encapsulation mfr
multilink
group 101

Now I need to manipulate the file in such a way that to all the numbers less than 163, 63 gets added and to all numbers greater than 163, 63 gets deducted.(The numbers means the numericals after "group") How do I do this using a bash/shell script?

Thanks
Shrijit

hope this will work.. (I couldn't test it)

awk '{if($0 ~ /^group/){if($2>163){printf "group %d\n",$2-63}else{printf "group %d\n",$2+63}}else{print}}' filename
nawk '$1=="group" {$NF+=($NF<163)?63:-63}1' myFile