class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.u: C = None
        self.o: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

l.z = h
l.t = h
l.u = k
l.o = d
l.w = i
d.u = i
d.o = f
d.r = l
k.o = h
k.q = h
k.z = f
k.p = f
k.w = f
h.r = l
h.u = l
h.x = d
i.r = l
i.z = l
i.t = l
f.u = i
f.o = d
f.r = l
assert k.p.o.r.t.txt == "h"