class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.v: E = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
g = B("g")
e = C("e")
j = D("j")
b = E("b")
n = C("n")

h.x = b
h.v = b
h.t = g
h.r = g
h.o = e
g.x = j
e.z = n
e.y = g
e.t = g
j.s = g
j.y = e
b.r = j
n.z = e
n.y = g
n.t = g
assert g.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.v: E = None
        self.o: C = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
g = B("g")
e = C("e")
j = D("j")
b = E("b")
n = C("n")

h.x = b
h.v = b
h.t = g
h.r = g
h.o = e
g.x = j
e.z = n
e.y = g
e.t = g
j.s = g
j.y = e
b.r = j
n.z = e
n.y = g
n.t = g
assert g.x.s.x.txt == "j"