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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.o: F = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.x: A = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

e = A("e")
k = B("k")
h = C("h")
b = D("b")
a = E("a")
g = F("g")

e.w = h
k.r = b
k.y = b
k.t = e
k.w = a
h.y = e
h.q = b
h.u = b
h.p = b
h.v = k
b.u = k
b.s = h
b.t = h
b.o = g
b.y = g
a.t = b
a.y = k
g.s = h
g.v = k
g.x = e
g.z = e
g.y = b
assert b.u.w.y.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.o: F = None
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.x: A = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

e = A("e")
k = B("k")
h = C("h")
b = D("b")
a = E("a")
g = F("g")

e.w = h
k.r = b
k.y = b
k.t = e
k.w = a
h.y = e
h.q = b
h.u = b
h.p = b
h.v = k
b.u = k
b.s = h
b.t = h
b.o = g
b.y = g
a.t = b
a.y = k
g.s = h
g.v = k
g.x = e
g.z = e
g.y = b
assert b.u.w.y.t.w.txt == "h"