Scripting help

I am completely new to scripting anything in Mikrotik outside the easy one-liners.

I am trying to get the IMEI of a device, save it to a variable (correct term? Or is it a string?) and then output the IMEI as a password later in the script.

I have figured out that the following lines will output the IMEI, but I don’t know where to go from there?
put [interface lte info lte1 once as-value ]
put ([interface lte info lte1 once as-value ]->“imei”)

Can anyone help with this?

:local imei
:set imei ([/interface lte info lte1 as-value once]->"imei")
:put ("all imei number: $imei")
:put ("first 3 digit: $[:pick $imei 0 3]")

This is perfect. Thank you!