Question: I'm new in `python` and while I was coding a little program I found a problem,

starting with a string like:

```
string = ('hello!')

```

I need to get a list like:

```
list = ['h','e','l','l','o','!']

```

How can i do?

Answer: 
`remain()` must be defined as `long long int`. 
The way you have it you multiply two `int`s here and observe an integer overflow:

```
else if(y%2==1) return ((remain(y-1))*(remain(1)))%d;

```

I have checked: as soon as I had fixed the definition to 

```
long long int remain(long long int y)

```

I got the expected result

Btw. you could have seen this with compiler warnings enabled, because the `printf()` would cause a compiler warning (at least gcc does)
I'm guessing you are overflowing the type you use. Maybe `int64_t remain(int64_t y);` will work.

I will use a wider type and fix the style of your code so that you see how to code properly. I will also make use of fixed-width integers, which are what you should be using 99% of the time (unless a good reason not to is present).

```
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>

int64_t a, i, d;

int64_t remain(int64_t y)
{
        int64_t temp;

        if (!y)
                return 1 % d;
        if (y == 1)
                return a % d;
        if (!(y % 2)) {
                temp = remain(y / 2);
                return (temp * temp) % d;
        }
        return (remain(y - 1) * remain(1)) % d;
}

int main(void)
{

        scanf("%"SNCi64" %"SCNi64" %"SCNi64"", &a, &i, &d);
        printf("%"PRIi64"\n", remain(i));

        return 0;
}

```

I didn't fix things such as using global variables, but you should.