class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.txt = txt

e = A("e")
h = B("h")
f = C("f")
k = D("k")
g = E("g")
c = D("c")

e.t = g
h.s = g
h.w = e
h.t = e
f.t = e
f.v = e
f.z = k
f.o = k
k.z = g
k.w = g
g.s = e
g.x = e
c.z = g
c.w = g
assert e.t.s.t.s.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.txt = txt

e = A("e")
h = B("h")
f = C("f")
k = D("k")
g = E("g")
c = D("c")

e.t = g
h.s = g
h.w = e
h.t = e
f.t = e
f.v = e
f.z = k
f.o = k
k.z = g
k.w = g
g.s = e
g.x = e
c.z = g
c.w = g
assert e.t.s.t.s.t.x.txt == "e"