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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: B = None
        self.p: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.r: E = None
        self.p: E = None
        self.txt = txt

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

a = A("a")
i = B("i")
h = C("h")
l = D("l")
d = E("d")
f = C("f")
k = C("k")

a.t = d
a.r = d
a.s = l
a.x = i
i.u = a
h.q = d
h.s = i
h.p = a
h.r = l
l.q = i
l.o = h
l.r = d
l.p = d
d.q = f
d.v = i
d.p = l
f.q = d
f.s = i
f.p = a
f.r = l
k.q = d
k.s = i
k.p = a
k.r = l
assert h.q.v.u.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: B = None
        self.p: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: C = None
        self.r: E = None
        self.p: E = None
        self.txt = txt

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

a = A("a")
i = B("i")
h = C("h")
l = D("l")
d = E("d")
f = C("f")
k = C("k")

a.t = d
a.r = d
a.s = l
a.x = i
i.u = a
h.q = d
h.s = i
h.p = a
h.r = l
l.q = i
l.o = h
l.r = d
l.p = d
d.q = f
d.v = i
d.p = l
f.q = d
f.s = i
f.p = a
f.r = l
k.q = d
k.s = i
k.p = a
k.r = l
assert h.q.v.u.t.v.txt == "i"