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

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

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

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

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

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

e = A("e")
h = B("h")
g = C("g")
k = D("k")
c = E("c")
l = F("l")
d = F("d")

e.x = g
h.s = l
g.v = c
g.x = e
k.s = g
k.t = h
k.p = d
c.o = k
c.r = k
c.w = l
c.v = l
l.w = k
l.z = k
d.w = k
d.z = k
assert g.x.x.x.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

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

e = A("e")
h = B("h")
g = C("g")
k = D("k")
c = E("c")
l = F("l")
d = F("d")

e.x = g
h.s = l
g.v = c
g.x = e
k.s = g
k.t = h
k.p = d
c.o = k
c.r = k
c.w = l
c.v = l
l.w = k
l.z = k
d.w = k
d.z = k
assert g.x.x.x.x.v.w.txt == "l"