class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.x: D = None
        self.w: C = None
        self.p: B = 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.s: D = None
        self.t: B = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

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

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

c = A("c")
d = B("d")
b = C("b")
g = D("g")
k = E("k")
l = C("l")

c.q = k
c.t = d
c.p = d
c.x = g
c.w = l
d.z = g
b.s = g
b.t = d
b.v = k
b.z = c
g.o = k
k.p = c
k.s = g
l.s = g
l.t = d
l.v = k
l.z = c
assert k.s.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.x: D = None
        self.w: C = None
        self.p: B = 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.s: D = None
        self.t: B = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

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

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

c = A("c")
d = B("d")
b = C("b")
g = D("g")
k = E("k")
l = C("l")

c.q = k
c.t = d
c.p = d
c.x = g
c.w = l
d.z = g
b.s = g
b.t = d
b.v = k
b.z = c
g.o = k
k.p = c
k.s = g
l.s = g
l.t = d
l.v = k
l.z = c
assert k.s.o.s.o.txt == "k"