## Introduction


Each chemical element in its neutral state has a specific number of electrons associated with it. This is represented by the **atomic number** which is noted by an integer number next to or above each element of the periodic table (as highlighted in the image above).

As we move from left to right, starting from the top row of the periodic table, each element differs from its predecessor by 1 unit (electron). Electrons fill in different orbitals sets according to a specific order. Each set of orbitals, when full, contains an even number of electrons.

The orbital sets are:
* The _**s** orbital_ - a single orbital that can hold a maximum of 2 electrons.
* The _**p** orbital set_ - can hold 6 electrons.
* The _**d** orbital set_ - can hold 10 electrons.
* The _**f** orbital set_ - can hold 14 electrons.


The order in which electrons are filling the different set of orbitals is shown in the picture above. First electrons will occupy the **1s** orbital, then the **2s**, then the **2p** set, **3s** and so on.

Electron configurations show how the number of electrons of an element is distributed across each orbital set. Each orbital is written as a sequence that follows the order in the picture, joined by the number of electrons contained in that orbital set. The final electron configuration is a single string of orbital names and number of electrons per orbital set where the first 2 digits of each substring represent the orbital name followed by a number that states the number of electrons that the orbital set contains.

For example, a string that demonstrates an electron configuration of a chemical element that contains 10 electrons is: `1s2 2s2 2p6`. This configuration shows that there are two electrons in the `1s` orbital set, two electrons in the `2s` orbital set, and six electrons in the `2p` orbital set. `2 + 2 + 6 = 10` electrons total.

___

# Task

Your task is to write a function that displays the electron configuration built according to the Madelung rule of all chemical elements of the periodic table. The argument will be the symbol of a chemical element, as displayed in the periodic table.

**Note**: There will be a preloaded array called `ELEMENTS` with chemical elements sorted by their atomic number.

For example, when the element "O" is fed into the function the output should look like: 

`"O -> 1s2 2s2 2p4"`

However, there are some exceptions! The electron configurations of the elements below should end as:

```
Cr -> ...3d5 4s1
Cu -> ...3d10 4s1
Nb -> ...4d4 5s1
Mo -> ...4d5 5s1
Ru -> ...4d7 5s1
Rh -> ...4d8 5s1
Pd -> ...4d10 5s0
Ag -> ...4d10 5s1
La -> ...4f0 5d1
Ce -> ...4f1 5d1
Gd -> ...4f7 5d1 6s2
Pt -> ...4f14 5d9 6s1
Au -> ...4f14 5d10 6s1
Ac -> ...5f0 6d1 7s2
Th -> ...5f0 6d2 7s2
Pa -> ...5f2 6d1 7s2
U  -> ...5f3 6d1 7s2
Np -> ...5f4 6d1 7s2
Cm -> ...5f7 6d1 7s2
```

**Note**: for `Ni` the electron configuration should be `3d8 4s2` instead of `3d9 4s1`.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

def _disabled_input(*args, **kwargs):
    raise RuntimeError("input() is disabled in callable mode")
builtins.input = _disabled_input

ns = {"__name__": "__judge__"}  # prevent if __name__ == "__main__" blocks
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "ELEMENTS = ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']\ndef get_electron_configuration(element):\n    atomic_no, n = ELEMENTS.index(element)+1, 0\n    orbitals = {'1s':0,'2s':0,'2p':0,'3s':0,'3p':0,'3d':0,'4s':0,'4p':0,'4d':0,'4f':0,'5s':0,'5p':0,'5d':0,'5f':0,'6s':0,'6p':0,'6d':0,'6f':0,'7s':0,'7p':0,'7d':0,'7f':0}\n    exceptions = {'Cr' : 'Cr -> 1s2 2s2 2p6 3s2 3p6 3d5 4s1','Cu': 'Cu -> 1s2 2s2 2p6 3s2 3p6 3d10 4s1','Nb': 'Nb -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d4 5s1','Mo':'Mo -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d5 5s1','Ru': 'Ru -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d7 5s1','Rh': 'Rh -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d8 5s1','Pd': 'Pd -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s0','Ag': 'Ag -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s1','La': 'La -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f0 5s2 5p6 5d1 6s2','Ce': 'Ce -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f1 5s2 5p6 5d1 6s2','Gd': 'Gd -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f7 5s2 5p6 5d1 6s2','Pt': 'Pt -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d9 6s1','Au': 'Au -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 6s1','Ac': 'Ac -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f0 6s2 6p6 6d1 7s2','Th': 'Th -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f0 6s2 6p6 6d2 7s2','Pa': 'Pa -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f2 6s2 6p6 6d1 7s2','U': 'U -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f3 6s2 6p6 6d1 7s2','Np': 'Np -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f4 6s2 6p6 6d1 7s2','Cm': 'Cm -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 4f14 5s2 5p6 5d10 5f7 6s2 6p6 6d1 7s2'}\n    if element in exceptions:\n        return exceptions[element]\n    while n < atomic_no:\n        if n < 2:\n            orbitals['1s'] += 1\n        elif n < 4:\n            orbitals['2s'] += 1\n        elif n < 10:\n            orbitals['2p'] += 1\n        elif n < 12:\n            orbitals['3s'] += 1\n        elif n < 18:\n            orbitals['3p'] += 1\n        elif n < 20:\n            orbitals['4s'] += 1\n        elif n < 30:\n            orbitals['3d'] += 1\n        elif n < 36:\n            orbitals['4p'] += 1\n        elif n < 38:\n            orbitals['5s'] += 1\n        elif n < 48:\n            orbitals['4d'] += 1\n        elif n < 54:\n            orbitals['5p'] += 1\n        elif n < 56:\n            orbitals['6s'] += 1\n        elif n < 70:\n            orbitals['4f'] += 1\n        elif n < 80:\n            orbitals['5d'] += 1\n        elif n < 86:\n            orbitals['6p'] += 1\n        elif n < 88:\n            orbitals['7s'] += 1\n        elif n < 102:\n            orbitals['5f'] += 1\n        elif n < 112:\n            orbitals['6d'] += 1\n        elif n < 118:\n            orbitals['7p'] += 1\n        n += 1\n    st = ''\n    orbs = ['1s','2s','2p','3s','3p','3d','4s','4p','4d','4f','5s','5p','5d','5f','6s','6p','6d','6f','7s','7p','7d','7f']\n    for x in orbs:\n        if orbitals[x] != 0:\n            st += x+str(orbitals[x])+' '\n    return element+' -> '+st.rstrip()\n    \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n        \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

_target = None
_fn_name = 'get_electron_configuration'
if _fn_name:
    if "Solution" in ns:
        try:
            _obj = ns["Solution"]()
            if hasattr(_obj, _fn_name):
                _target = getattr(_obj, _fn_name)
        except Exception:
            _target = None
    if _target is None and _fn_name in ns and callable(ns[_fn_name]):
        _target = ns[_fn_name]
# Fallback: if there's exactly one user-defined function, use it
if _target is None:
    _cands = [v for k, v in ns.items() if callable(v) and getattr(v, "__module__", "") in ("__judge__", "__main__")]
    _user_funcs = [c for c in _cands if getattr(c, "__name__", "").startswith("_") is False]
    if len(_user_funcs) == 1:
        _target = _user_funcs[0]
if _target is None:
    raise RuntimeError(f"Could not resolve callable '{_fn_name}'")

_raw = sys.stdin.read().strip()
if _raw:
    _parsed = json.loads(_raw)
    if isinstance(_parsed, dict):
        _kwargs = _parsed.get("kwargs", {})
        _args = _parsed.get("args", [])
    else:
        _args, _kwargs = _parsed, {}
else:
    _args, _kwargs = [], {}
if not isinstance(_args, (list, tuple)):
    _args = [_args]
_res = _target(*_args, **_kwargs)
try:
    sys.stdout.write(repr(_res) + "\n")
except Exception:
    pass

```

Measured memory_bytes: 8035