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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
a = C("a")
e = D("e")
k = E("k")
d = E("d")
m = B("m")
j = C("j")

l.r = m
l.t = m
l.p = j
l.x = f
f.z = e
f.u = l
f.p = a
a.o = l
a.t = j
e.y = l
k.q = a
k.u = e
k.r = e
k.p = j
k.w = l
d.q = j
d.p = j
d.u = e
d.r = e
d.w = l
m.z = e
m.u = l
m.p = a
j.o = l
j.t = a
assert k.q.t.t.t.o.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

l = A("l")
f = B("f")
a = C("a")
e = D("e")
k = E("k")
d = E("d")
m = B("m")
j = C("j")

l.r = m
l.t = m
l.p = j
l.x = f
f.z = e
f.u = l
f.p = a
a.o = l
a.t = j
e.y = l
k.q = a
k.u = e
k.r = e
k.p = j
k.w = l
d.q = j
d.p = j
d.u = e
d.r = e
d.w = l
m.z = e
m.u = l
m.p = a
j.o = l
j.t = a
assert k.q.t.t.t.o.t.z.txt == "e"