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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.x: D = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

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

k.t = g
k.r = c
k.v = b
k.u = d
c.q = b
c.r = n
c.s = n
c.t = k
n.z = k
n.t = c
n.y = g
n.p = d
d.s = c
d.w = c
b.v = c
b.t = c
b.z = c
b.x = d
b.o = d
g.z = k
g.t = c
g.y = n
g.p = d
assert k.r.t.v.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.x: D = None
        self.o: D = None
        self.z: B = None
        self.txt = txt

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

k.t = g
k.r = c
k.v = b
k.u = d
c.q = b
c.r = n
c.s = n
c.t = k
n.z = k
n.t = c
n.y = g
n.p = d
d.s = c
d.w = c
b.v = c
b.t = c
b.z = c
b.x = d
b.o = d
g.z = k
g.t = c
g.y = n
g.p = d
assert k.r.t.v.o.w.txt == "c"