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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.q: F = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.txt = txt

e = A("e")
k = B("k")
b = C("b")
f = D("f")
m = E("m")
l = F("l")
g = E("g")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.q: F = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.txt = txt

e = A("e")
k = B("k")
b = C("b")
f = D("f")
m = E("m")
l = F("l")
g = E("g")

e.u = m
e.z = k
e.q = b
k.w = l
k.q = l
k.u = b
k.r = f
b.v = e
f.w = k
m.o = l
m.t = f
m.u = e
m.z = b
m.v = b
l.y = g
l.x = k
g.o = l
g.t = f
g.u = e
g.z = b
g.v = b
assert k.r.w.w.txt == "l"