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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.u: D = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

i = A("i")
a = B("a")
d = C("d")
c = D("c")
h = E("h")
j = D("j")
k = E("k")

i.t = a
i.x = a
i.p = c
a.z = c
d.v = h
d.w = c
d.x = i
c.y = d
c.q = a
c.p = a
c.u = j
c.t = h
h.o = k
j.y = d
j.q = a
j.p = a
j.u = c
j.t = k
k.o = h
assert k.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: B = None
        self.u: D = None
        self.t: E = None
        self.p: B = None
        self.txt = txt

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

i = A("i")
a = B("a")
d = C("d")
c = D("c")
h = E("h")
j = D("j")
k = E("k")

i.t = a
i.x = a
i.p = c
a.z = c
d.v = h
d.w = c
d.x = i
c.y = d
c.q = a
c.p = a
c.u = j
c.t = h
h.o = k
j.y = d
j.q = a
j.p = a
j.u = c
j.t = k
k.o = h
assert k.o.o.o.o.txt == "k"